undefined being treated as a missing optional argument

Allen Wirfs-Brock allen at wirfs-brock.com
Fri Apr 13 09:26:58 PDT 2012


On Apr 12, 2012, at 7:31 PM, Luke Hoban wrote:

> ...

> This is a good way of explaining the proposed semantics, but...
> 
>> But I see why somebody calling a function defined as function(a={ }){...} explicitly as f(undefined) would expect to trigger the default  value initializer.
> 
> Right.  This is exactly the sort of thing I'm worried about, and seems like the practical common case for default values.  
> 

Oops, I meant "I don't see why...".  Some of my negations don't seem to be getting from my head to my finger as I type...

Restating, when I type f(undefined)  I'm thinking something quite different from f()

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120413/b99fa27f/attachment.html>


More information about the es-discuss mailing list