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

Parses invalid escaped new.target #1856

Open
ghost opened this Issue Sep 24, 2017 · 1 comment

Comments

Projects
None yet
0 participants
@ghost

ghost commented Sep 24, 2017

The target contextual keyword must not contain Unicode escape sequences.

esprima.parse('function f() { new.t\\u0061rget; }')

Expected output

To throw an error

Actual output

Parses an AST node

Relevant references

TC39

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Sep 25, 2017

This one isn't tricky to solve. Check if the string literal value in the scanner matches target and if it's escaped. If that's the case- throw. Because this one isn't an identifier or keyword.

ghost commented Sep 25, 2017

This one isn't tricky to solve. Check if the string literal value in the scanner matches target and if it's escaped. If that's the case- throw. Because this one isn't an identifier or keyword.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment