Bug 200638
Summary: | jsc errors on unicode escapes in keywords in non-keyword positions | ||
---|---|---|---|
Product: | WebKit | Reporter: | Wesley Wigham <wwigham> |
Component: | JavaScriptCore | Assignee: | 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 |
Wesley Wigham
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.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Wesley Wigham
Apologies, the error in JSC isn't the one listed above, but rather
`SyntaxError: Unexpected escaped characters in keyword token: 'def\u0061ult'`.
Wesley Wigham
Relevant test262 issue, since there doesn't seem to be a test covering it yet: https://github.com/tc39/test262/issues/2285
Radar WebKit Bug Importer
<rdar://problem/54277270>
Alexey Shvayka
(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 ***