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

Add negative tests for legacy octal escape sequences in strings #1062

Closed
ajklein opened this issue Jun 19, 2017 · 1 comment
Closed

Add negative tests for legacy octal escape sequences in strings #1062

ajklein opened this issue Jun 19, 2017 · 1 comment

Comments

@ajklein
Copy link
Contributor

ajklein commented Jun 19, 2017

Annex B.1.2 defines legacy octal escape sequences in string literals. From what I can tell, test262 doesn't have coverage of these, either for their acceptance in sloppy mode code nor for them being disallowed in strict mode code (as Section 11.8.4 requires).

Thanks to the reporter of this v8 issue for bringing this to my attention.

@bakkot
Copy link
Contributor

bakkot commented Jun 19, 2017

There's four things to be covered here: octal escapes (\01 etc) and non-octal escapes (\08 and \09), each in sloppy and strict code.

In sloppy code both are accepted but with different semantics (LegacyOctalEscapeSequence:: ZeroToThree OctalDigit [lookahead ∉ OctalDigit] and LegacyOctalEscapeSequence :: OctalDigit [lookahead ∉ OctalDigit] respectively). In strict code both are rejected (EscapeSequence :: 0 [lookahead ∉ DecimalDigit]).

I believe there's coverage for octal/sloppy and noctal/sloppy here, and coverage for octal/strict here (edit: and here).

The only missing case is noctals in strict code: that is, we don't test that '\08' is forbidden in strict code. (That's also, incidentally, the only case v8 gets wrong.)

@ajklein ajklein changed the title Add tests for legacy octal escape sequences in strings Add negative tests for legacy octal escape sequences in strings Jun 19, 2017
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

No branches or pull requests

2 participants