Reserved words in JS (Was: [XBL] Use of "public")

On Wed, 14 Feb 2007, Cameron McCormack wrote:
>
> Cameron McCormack:
> > Unless I am mistaken, reserved words in ECMAScript don't apply when you 
> > are dereferencing an object. so "this.public.x" is fine.
> 
> I think you’re thinking of the so-called “contextually reserved
> identifiers”.
> 
>   >>> o = { 'public': 123 }
>   [object Object]
>   >>> o.public
>   org.mozilla.javascript.EvaluatorException: missing name after
>     . operator (System.in#2)

That doesn't seem to be ECMAScript 3rd edition compliant (ReservedWord is 
only not allowed for Identifier, and the "public" in "o.public" isn't an 
Identifier as far as I can tell). It's also not what happens when you run 
the above code in Mozilla's browser JS interpreter. Weird.

Oh well. Doesn't matter, change was made anyway.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Wednesday, 14 February 2007 20:27:40 UTC