[Bug 23056] Function's length property is inconsistent with EcmaScript

https://www.w3.org/Bugs/Public/show_bug.cgi?id=23056

Allen Wirfs-Brock <allen@wirfs-brock.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |allen@wirfs-brock.com

--- Comment #4 from Allen Wirfs-Brock <allen@wirfs-brock.com> ---
(In reply to comment #3)
> The ES6 spec is a bit unclear here.

what exactly is unclear?

> 
> In particular, see section 8.3.16.6 in the draft you link to, which
> explicitly sets the length to the ExpectedArgumentCount of the
> ParameterList.  And the definition of that is on page 201 (section 13.1) and
> returns:
> 
>   the number of FormalParameters to the left of either the rest parameter or
> the
>   first FormalParameter with an Initialiser.  A FormalParameter without an
>   initialiser is allowed after the first parameter with an initialiser but
> such
>   parameters are considered to be optional with undefined as their default
> value.
> 

The above quote is an informal description of ExpectedArgumentCount from an
informative note.  If you trace through the actual normative algorithm so see
what it computes for any specific parameter list.  The note should be
consistent with the results you get.

> So it sort of depends on what one means by "optional argument", I guess.... 
> We should take this to public-script-coord.

Right, in particular what WebIDL means by "optional argument".  I optional
argument is equivalent to "A FormalParameter without an initialiser" then it
should exactly match the ES6 rule (for the shortest WebIDL overload).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Tuesday, 27 August 2013 23:08:28 UTC