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

Re: [Future] First arguments should not be optional

From: Cameron McCormack <cam@mcc.id.au>
Date: Thu, 09 May 2013 08:39:59 +1000
Message-ID: <518AD43F.2040402@mcc.id.au>
To: Jonas Sicking <jonas@sicking.cc>
CC: Domenic Denicola <domenic@domenicdenicola.com>, Mounir Lamouri <mounir@lamouri.fr>, "www-dom@w3.org" <www-dom@w3.org>
Jonas Sicking wrote:
> On Wed, May 8, 2013 at 11:02 AM, Domenic Denicola
> <domenic@domenicdenicola.com>  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.
>
> That's the agreed upon behavior for WebIDL as way, however I don't
> think the spec has yet been updated to match that.

Yes.  You should be able to write

   Future catch(optional AnyCallback rejectCallback);

and have that cause

   new Future().catch(undefined)

to mean the same as

   new Future().catch()

while

   new Future().catch(null)

throws.

Spec fix coming some time soon...
Received on Wednesday, 8 May 2013 22:40:45 UTC

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