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

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

From: Garrett Smith <dhtmlkitchen@gmail.com>
Date: Mon, 26 Aug 2013 10:05:07 -0700
Message-ID: <CABZUbM2ZwL6jsrvGon9h3jJGSCp8vtjXuaUQJquDU-P98A3-hw@mail.gmail.com>
To: bugzilla@jessica.w3.org
Cc: public-script-coord@w3.org
On 8/25/13, bugzilla@jessica.w3.org <bugzilla@jessica.w3.org> wrote:
> https://www.w3.org/Bugs/Public/show_bug.cgi?id=23056
>
> --- Comment #3 from Boris Zbarsky <bzbarsky@mit.edu> ---
> The ES6 spec is a bit unclear here.
>
> 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:
>
ExpectedArgumentCount includes arguments that may be omitted, but have
defaults, such as String.prototype.slice(s, e), where if e is omitted,
the string's length is used.

| For example, the Function object that is the initial value of the
| slice property of the String prototype object is described under
| the subclause heading “String.prototype.slice (start, end)” which
| shows the two named arguments start and end; therefore the
| value of the length property of that Function object is 2.

Then again, String.prototype.indexOf (searchString, position)'s length
is 1; If position is undefined, 0 is assumed. According to the
explanation in the spec, it should be 2.

WebIDL defines "optional" formally in one place which seems like a good idea.
--
Garrett
Twitter: @xkit
personx.tumblr.com
Received on Monday, 26 August 2013 17:05:34 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:37:50 UTC