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

Fix misleading error message for octal escapes in template strings #678

Merged
merged 1 commit into from
Mar 3, 2018

Conversation

not-an-aardvark
Copy link
Contributor

When parsing code like this:

`\033`;

Acorn produces the following error message:

SyntaxError: Octal literal in strict mode (1:1)

This error message is a bit misleading because the code is not in strict mode. It's correct to report an error here, but the error is actually because the octal escape sequence is in a template literal.

This commit updates the error message to include something about template strings, rather than claiming that the error is due to strict mode.

This updates the error message for something like `\033` to include something about template strings, rather than claiming that the error is due to strict mode.
@marijnh marijnh merged commit 42f6379 into acornjs:master Mar 3, 2018
@marijnh
Copy link
Member

marijnh commented Mar 3, 2018

Thank you, that's indeed an improvement. Merged!

@not-an-aardvark not-an-aardvark deleted the octal-template-message branch March 3, 2018 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants