Bug 200638

Summary: jsc errors on unicode escapes in keywords in non-keyword positions
Product: WebKit Reporter: Wesley Wigham <wwigham>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ashvayka, fpizlo, keith_miller, mark.lam, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Windows 10   

Description Wesley Wigham 2019-08-12 11:50:36 PDT
Steps to reproduce the problem:
1. Paste `const a = {def\u0061ult: 12}` into interpreter

What is the expected behavior?
No errors, `a` is an object with a member named `default` with value `12`.

What went wrong?
`Uncaught SyntaxError: Keyword must not contain escaped characters`

Relevant spec section: https://tc39.es/ecma262/#prod-IdentifierName

This works in chakra-based edge and firefox, however chrome exhibits the same [bug](https://bugs.chromium.org/p/chromium/issues/detail?id=993000&can=2&q=unicode%20escape). I happened to find this while working on https://github.com/microsoft/TypeScript/pull/32718.
Comment 1 Wesley Wigham 2019-08-12 11:51:56 PDT
Apologies, the error in JSC isn't the one listed above, but rather
`SyntaxError: Unexpected escaped characters in keyword token: 'def\u0061ult'`.
Comment 2 Wesley Wigham 2019-08-12 16:56:21 PDT
Relevant test262 issue, since there doesn't seem to be a test covering it yet: https://github.com/tc39/test262/issues/2285
Comment 3 Radar WebKit Bug Importer 2019-08-13 15:36:21 PDT
<rdar://problem/54277270>
Comment 4 Alexey Shvayka 2020-12-06 07:38:22 PST
(In reply to Wesley Wigham from comment #2)
> Relevant test262 issue, since there doesn't seem to be a test covering it
> yet: https://github.com/tc39/test262/issues/2285

Thank you Wesley for discovering this and filing the issues.
It's so great there so many projects contributing back to test262!

Yusuke fixed this in r270481.

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