Bug 200638 - jsc errors on unicode escapes in keywords in non-keyword positions
Summary: jsc errors on unicode escapes in keywords in non-keyword positions
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Other
Hardware: Unspecified Windows 10
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-08-12 11:50 PDT by Wesley Wigham
Modified: 2019-08-13 15:36 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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>