Skip to content

optional loader behavior for factory arity < 3 #33

Open
@hax

Description

@hax

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 babel/babel#3620 try to solve.

Suggestion: Just remove it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions