amdjs / amdjs-api

Houses the Asynchronous Module Definition API
https://groups.google.com/group/amd-implement
4.31k stars 499 forks source link

optional loader behavior for factory arity < 3 #33

Open hax opened 7 years ago

hax commented 7 years ago

However, if the factory function's arity (length property) is less than 3, then the loader may choose to only call the factory with the number of arguments corresponding to the function's arity or length.

This optional loader behavior for factory arity < 3 is unnecessary and introduce potential inconsistency.

Prior ES6, arguments can be used to get actual arguments; and in ES6+, the arity of function (a, b = 0, c) is 1. In both cases, the loaders which choose or not choose this behavior will have different results.

This paragraph also make some misunderstanding of allowing loader not call factory if arity == 0, like https://github.com/babel/babel/pull/3620 try to solve.

Suggestion: Just remove it.