Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing error for keywords with escaped characters #32700

Closed
ajafff opened this issue Aug 4, 2019 · 3 comments · Fixed by #32718
Closed

Missing error for keywords with escaped characters #32700

ajafff opened this issue Aug 4, 2019 · 3 comments · Fixed by #32718
Labels
Bug A bug in TypeScript
Milestone

Comments

@ajafff
Copy link
Contributor

ajafff commented Aug 4, 2019

TypeScript Version: 3.6.0-dev.20190804

Search Terms:

Code

v\u0061r a = 1;
// parses as: 'var a = 1;'

Expected behavior:
Keyword must not contain escaped characters

Actual behavior:
No parse/compile error. Instead Chrome gives Uncaught SyntaxError: Keyword must not contain escaped characters

Playground Link: doesn't use the correct version yet

Related Issues:
#32096 made parsing the above code possible. cc @weswigham

@weswigham
Copy link
Member

Hah, neat. I guess we need a dedicated error for this now.

@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Aug 5, 2019
@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Aug 5, 2019
@RyanCavanaugh
Copy link
Member

image

😅

@weswigham
Copy link
Member

So we apparently already had a test for this - scannerUnicodeEscapeInKeyword1.ts - which has existed since the compiler was uploaded to github. It just has the wrong behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants