Comment #3 on issue 1972 by [email protected]: Incorrect treatment of unicode escapes in keywords
http://code.google.com/p/v8/issues/detail?id=1972

Keywords cannot contain unicode escapes, so
  v\u0061r x = 0
is a syntax error on two fronts.
The sequence "v\u0061r" can only be tokenized as an IdentifierName.
It's not the "var" keyword, since that can't contain escapes. It is equivalent to the IdentifierName "var". However, that is not an Identifier, since Identifier is "IdentifierName but not ReservedWord" and "var" is a reserved word.

So, the only place you can use "v\u0061r" is as an object literal property name or after a ".", where you can use a plain IdentifierName.

Browsers generally (AFAIR) used to treat "v\u0061r" as an Identifier, so "var v\u0061r = 9" would work. Some might have changed that.

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to