On Thu, Apr 12, 2012 at 4:11 PM, gaz Heyes <gazhe...@gmail.com> wrote: > On 12 April 2012 14:51, Lasse Reichstein <reichsteinatw...@gmail.com> wrote: >> >> On Thu, Apr 12, 2012 at 2:58 PM, gaz Heyes <gazhe...@gmail.com> wrote: >> > function true(){alert('Call me');}; >> >> Is this a deliberate Mozilla change, or just a bug ("true" being a >> keyword and not valid as a function name in plain ECMAScript)? >> >> And, btw, >> /* MY CODE */ >> tru\u0065(); > > > Haha nice try even with unicode escapes it still refers to "true" the > boolean not the function.
I guess that depends on the version. I was testing in Firefox 9.0.1, and it runs your function. In any case, the example is invalid ECMAScript, and I expect it to be fixed eventually (someone linked the Mozilla bug). The current ES5 spec (and ES3 too) is ... vague ... on the meaning of tru\u0065, which explains the different implementations, but in order to "not break the web" the most common meaning has been to make it an IdentifierName but not a keyword. I.e., only "true" can be the keyword, but "tru\u0065" can be used as an identifier. I know I have implemented that to match Safari and Firefox, where my personal preference would be to throw a syntax error :). /L _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss