More fun with undefined

Rick Waldron waldron.rick at gmail.com
Thu Jun 14 15:49:53 PDT 2012


On Thu, Jun 14, 2012 at 5:35 PM, Thaddee Tyl <thaddee.tyl at gmail.com> wrote:

> On Thu, Jun 14, 2012 at 3:29 PM, Allen Wirfs-Brock
> <allen at wirfs-brock.com> wrote:
> > This is a different issue, but I wonder how badly the web would break if
> we
> > made undefined a reserved word.  Does anybody in JS really declare a
> > different local binding for undefined?  In ES5 we got away with making
> > undefined read-only.  Maybe we should continue pushing and see if we can
> > eliminate the rebindable undefined hazard.
>
> JQuery [1] famously has an "undefined" parameter, like so:
>
>    (function( window, undefined ) { … }(window))
>


Actually, this exists because undefined wasn't reserved. We would certainly
remove the formal param in favor of an reserved undefined. Unfortunately,
we can't "take it back" in extant code.


Rick




>
> What would happen in this case?
>
>  [1] http://code.jquery.com/jquery-1.7.2.js
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120614/dc0707d7/attachment.html>


More information about the es-discuss mailing list