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

Need tests for \8 in templates and strict strings #2653

Closed
rkirsling opened this issue Jun 8, 2020 · 4 comments · Fixed by #2654
Closed

Need tests for \8 in templates and strict strings #2653

rkirsling opened this issue Jun 8, 2020 · 4 comments · Fixed by #2654

Comments

@rkirsling
Copy link
Member

Looks like tests for \8 were missed from #1063.

Everyone agrees that \08 is bad outside of sloppy non-template strings, but SM, V8, XS, and ChakraCore all accept `\8` and '\8' regardless of mode.

Templates should hit the NotEscapeSequence early errors in 12.2.9.1 while strict non-templates should fail to lex altogether per the definition of CharacterEscapeSequence in 11.8.4.

@anba
Copy link
Contributor

anba commented Jun 9, 2020

\8 isn't allowed in any mode per spec (*). As non-standard extension, some engines allow it in strict and non-strict mode, and other engines only allow it in non-strict mode.

(*) B.1.1 Numeric Literals supports noctal digits through NonOctalDecimalIntegerLiteral, whereas B.1.2 String Literals doesn't have an equivalent production rule.

@rkirsling
Copy link
Member Author

rkirsling commented Jun 9, 2020

Oh hmm, you're right that B.1.2 doesn't actually call out 8 and 9 after all.

This feels really weird to have unspecified though, right? Perhaps we should add a NODIL-equivalent production to B.1.2, since everyone agrees on sloppy (non-template) strings?

@anba
Copy link
Contributor

anba commented Jun 9, 2020

It's already planned to resolve this for ES7: https://tc39.es/archives/bugzilla/3477/ 😄

@rkirsling
Copy link
Member Author

rkirsling commented Jun 9, 2020

Hah, wow! Guess I'll open a 262 ticket tomorrow then. 😅

Edit: Opened tc39/ecma262#2039.

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 a pull request may close this issue.

2 participants