[Bug 19571] .length should count optional arguments

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

Erik Arvidsson <arv@chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |arv@chromium.org

--- Comment #1 from Erik Arvidsson <arv@chromium.org> ---
There has been lot of discussion regarding this and at the moment we are
sticking to what is in the ES6 draft.

Function .length is not very useful either way you go. To be able to do feature
detection related to the arity of a function a better reflection mechanism is
needed. For example, DOMTokenList.prototype.add changed from "DOMString token"
to "DOMString... tokens". Would you want length to be 0, 1 or Infinity in that
case? With ES6 length becomes 0 because that is the number of required
parameters, the least number of parameters needed for the function to "work".

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

Received on Wednesday, 17 October 2012 14:49:14 UTC