obsoleting the "new" keyword

Brendan Eich brendan at mozilla.com
Sun Jan 18 20:33:41 PST 2009


On Jan 18, 2009, at 5:48 PM, Mark S. Miller wrote:

> On Sun, Jan 18, 2009 at 4:35 PM, Brendan Eich <brendan at mozilla.com>  
> wrote:
>
> We also allow keywords as property names in JS1.7+ and did for ES4  
> -- this relaxation from current context-free reservation of  
> identifiers has been talked about for 3.1 too, and IIRC it was  
> agreed to for Harmony at last summer's Oslo meeting.
>
> It's in the ES3.1 grammar. In ES3.1, x.if is equivalent to x['if'],  
> and ({if: x}) is equivalent to ({'if': x}).

The other unreserved context in JS1.7 and later is after the  
'function' keyword. Unambiguous, complementary, useful for some cases.  
It's easy to tweak ES3.1's grammar to allow keywords in this context  
too. Thoughts?

/be
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20090118/42b28a70/attachment.html>


More information about the Es-discuss mailing list