W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2013

Re: [Future] First arguments should not be optional

From: Garrett Smith <dhtmlkitchen@gmail.com>
Date: Wed, 8 May 2013 13:55:43 -0700
Message-ID: <CABZUbM3==1oYy_O3wGRF_U-8u4V57oksX00VXLiPrBRxSzNVdg@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: www-dom@w3.org, "public-script-coord@w3.org" <public-script-coord@w3.org>
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

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:20 UTC