W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2013

Re: Promises "if not omitted" language

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 22 Jul 2013 12:49:07 -0400
Message-ID: <51ED6283.2060807@mit.edu>
To: Domenic Denicola <domenic@domenicdenicola.com>
CC: "public-script-coord@w3.org" <public-script-coord@w3.org>
On 7/22/13 12:44 PM, Domenic Denicola wrote:
> From: Boris Zbarsky [bzbarsky@MIT.EDU]
>> There's a third choice: undefined and both null trigger default behavior, functions get called, anything else is disallowed.
>> Or is that what you mean by the "antipattern that DOM specs in particular have perpetuated"?
> Yes, exactly.
> (As another example: compare `["a", "b"].join(null)` vs. `["a", "b"].join(undefined)`.)

That's a quite different situation, because the argument to join() is 
fundamentally expected to be a string, not an object.

A lot of the cases where the DOM treats null in some special way have to 
do with situations where the input is the return value of some other API 
that can return null...

But in this case, I think we're not in that situation, so there is no 
need to treat null specially.

Received on Monday, 22 July 2013 16:49:36 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:17 UTC