Function.length and Default Parameters

Kevin Smith khs4473 at gmail.com
Wed Oct 10 09:43:56 PDT 2012


I notice that the current draft spec says:

>> The ExpectedArgumentCount of a FormalParameterList is the
>> number of FormalParameters to the left of either the rest parameter
>> or the first FormalParameter with an Initialiser.

This aligns ExpectedArgumentCount with built-in functions like
Array.prototype.splice in specifying (more or less) the minimum number of
arguments for the function to work properly.

Leaving aside congruence with built-in functions, it seems like it would be
more helpful to know the total number of formals, minus the rest parameter.
 Is there any other reason to favor the current semantics?

Kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121010/a9db4d18/attachment.html>


More information about the es-discuss mailing list