Is \u006eew a valid Identifier?

Caitlin Potter caitpotter88 at
Sat Nov 7 15:32:45 UTC 2015

That it works in Chrome is a bug, which will hopefully be fixed by Monday or Tuesday!

Per, “new” is a Keyword, which makes it a ReservedWord.

Per, under the
“Identifier: IdentifierName but not ReservedWord” section, the second early error applies here. This applies to
`new`, which is always a reserved word. So whenever an Identifier is expected, if it contains UnicodeEscapeSequences which result in the same StringValue as a ReservedWord, it’s an error.

The spec is similarly explicit in saying that escaped ReservedWords are not valid as ReservedWords. Browsers behave differently here (for instance, <<< at the time of this writing Webkit Nightly prints the text, while other browsers SyntaxError. in Chromes case, this is because it’s tokenized as an Identifier, so the second Identifier “f” is unexpected when parsing a MemberExpression. SpiderMonkey is doing a nice job of reporting clean errors for this kind of thing, that are easier to understand.

There are some odd points though:

1. ReservedWord restrictions never apply to `get` or `set`, even in ObjectLiterals (though currently Chrome fails to treat `g\u{65}t` or `s\u{65}t` as an accessor prefix, this is a bug).

2. In the case of “”, it’s technically legal to write `new.t\u{61}rget`, but this mostly just seems like an oversight in the spec.

> On Nov 7, 2015, at 9:50 AM, Eric Suen < at> wrote:
> "The ReservedWord definitions are specified as literal sequences of
> specific SourceCharacter elements. A code point in a ReservedWord
> cannot be expressed by a \ UnicodeEscapeSequence." - what does it
> mean?
> The following code is valid in Chrome, but invalid in firefox and IE.
> var \u006eew = 1; // \u006e = 'n'
> and valid in Babel/Traceur, invalid in typescript/esprima...
> --
> ------------------------------------------------
> Spket IDE - Development Tool for RIA.
> _______________________________________________
> es-discuss mailing list
> es-discuss at

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <>

More information about the es-discuss mailing list