Question about allowed characters in identifier names

Norbert Lindenberg ecmascript at
Sat Aug 24 13:13:44 PDT 2013

On Aug 24, 2013, at 2:02 , Mathias Bynens <mathias at> wrote:

> On 27 Feb 2012, at 22:58, Allen Wirfs-Brock <allen at> wrote:

>> var \ud87e\udc00 would probably still be illegal because each \uXXXX define a separate character but: var \u{2f800} =42; schould be find as should the direct none escaped occurrence of that characters.
> Wouldn’t this be confusing, though?
>    global['\u{2F800}'] = 42; // would work (compatible with ES5 behavior)
>    global['\uD87E\uDC00'] = 42; // would work, too, since `'\uD87E\uDC00' == '\u{2F800}'` (compatible with ES5 behavior)
>    var \uD87E\uDC00 = 42; // would fail (compatible with ES5 behavior)
>    var \u{2F800} = 42; // would work (as per your comment; incompatible with ES5 behavior)
>    var 丽 = 42; // would work (as per your comment; incompatible with ES5 behavior)

I do think it's confusing that \uD87E\uDC00 is not allowed in the current ES6 spec, and have reported this as part 4 of

The issue was also discussed, without a conclusion, at the TC 39 meeting in July 2012 - look for "# Unicode support":

> Using astral symbols in identifiers would be backwards incompatible, even if the raw (unescaped) symbol is used. There’d be no way to use such an identifier in an ES5 environment. Is this a problem?

It's the same problem as when using
    let a = 42;

You should not expect that a program using new ES6 features will run on ES5 implementations (although it might run on some that have already added the ES6 features used).


More information about the es-discuss mailing list