Bug 167940 - Unable to use literal astral-plane unicode character in identifier in JavaScript
Summary: Unable to use literal astral-plane unicode character in identifier in JavaScript
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-07 08:42 PST by Claude Pache
Modified: 2017-12-27 06:18 PST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Claude Pache 2017-02-07 08:42:37 PST
Type:

    var 𐋀;

where the character before the semi-colon is U+102C0 (CARIAN LETTER G).

Equivalently, try:

    eval("var \u{102C0};"); // (note that the escape sequence is expanded when evaluating the string)

I get the error:

    SyntaxError: Invalid character '\u55296'

I expect: no error (because U+102C0 is a letter).

Note that the following code works as expected (no error):

    var \u{102C0};
Comment 1 Claude Pache 2017-02-07 09:58:33 PST
Maybe related: Bug 121541
Comment 2 Alexey Proskuryakov 2017-02-08 17:37:00 PST
Seems very basic, but I can't remember this come up before. Very surprising.