Re: [Future] First arguments should not be optional
Garrett Smith <[email protected]>
| Newsgroups | gmane.comp.web.dom.general |
|---|---|
| Message-ID | <CABZUbM3==1oYy_O3wGRF_U-8u4V57oksX00VXLiPrBRxSzNVdg@mail.gmail.com> |
On 5/8/13, Boris Zbarsky <[email protected]> wrote: > On 5/8/13 2:02 PM, Domenic Denicola wrote: >> This is a good illustration of the kind of conflict between DOM API >> designers and normal ECMAScript semantics. Normal ECMAScript semantics >> would demand that `undefined` and no parameter be treated the same > For normal algorithm handling, yes, they should be treated the same. | Unless otherwise specified in the description of a | particular function, if a function or constructor described | in this clause is given fewer arguments than the function | is specified to require, the function or constructor shall | behave exactly as if it had been given sufficient additional | arguments, each such argument being the undefined value. > Except for arguments.length. > The arguments object is problematic. Algorithms which discern between undefined and missing argument are exceptions to the general rule. -- Garrett Twitter: @xkit personx.tumblr.com