Bug 167940
Summary: | Unable to use literal astral-plane unicode character in identifier in JavaScript | ||
---|---|---|---|
Product: | WebKit | Reporter: | Claude Pache <claude.pache> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | ap, ashvayka, ebrahim, fpizlo, keith_miller, mark.lam, msaboff, saam, ysuzuki |
Priority: | P2 | ||
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Claude Pache
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};
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Claude Pache
Maybe related: Bug 121541
Alexey Proskuryakov
Seems very basic, but I can't remember this come up before. Very surprising.
Alexey Shvayka
(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 ***