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: RESOLVED DUPLICATE of bug 208998
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: 2020-03-23 10:19 PDT (History)
9 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.
Comment 3 Alexey Shvayka 2020-03-23 10:19:48 PDT
(In reply to Claude Pache from comment #0)
> I expect: no error (because U+102C0 is a letter).

As of https://trac.webkit.org/changeset/258531, the test case works as expected.

*** This bug has been marked as a duplicate of bug 208998 ***