Function.length and Default Parameters

Kevin Smith khs4473 at
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?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list