Re: [Future] First arguments should not be optional

On 5/8/13, Boris Zbarsky <bzbarsky@mit.edu> 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

Received on Wednesday, 8 May 2013 20:56:10 UTC