W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2013

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

From: <bugzilla@jessica.w3.org>
Date: Tue, 27 Aug 2013 23:08:26 +0000
To: public-script-coord@w3.org
Message-ID: <bug-23056-3890-Bd3lrPwn3I@http.www.w3.org/Bugs/Public/>

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 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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:18 UTC