On Wed, Dec 2, 2015 at 9:53 PM, ermouth <ermo...@gmail.com> wrote:
>> It is not possible to check how many arguments functions accepts?
>
> It is, `var fn=function(x,y){};fn.length ==> 2`. Although, you not
> necesserily write js function with all args. For example, I can define
> update (doc), without req obj if I don‘t need it. Gist below uses only
> first arg of 4 in validate_doc_update.

Hm...good point. Such JS feature ruins this use-case. Thanks!

So we have two candidates left:
- require()
- this

And seems like this is simpler both for users, developers and for
implementation, since there is no need to hack require or inject
special CommonJS lib in order to make things work.

--
,,,^..^,,,

Reply via email to