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 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 offunction (a, b = 0, c)
is1
. 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.