Re: Promises "if not omitted" language

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.

-Boris

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