Re: [Future] First arguments should not be optional

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