-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
\8 in sloppy non-template strings remains unspecified #2039
Comments
I don't like calling things like this "unspecified". There are source texts which must be accepted by a conforming implementation, source texts which must be rejected by a conforming implementation (due to Forbidden Extensions or Early Errors, maybe other reasons), and source text which may be accepted by a conforming implementation but are not required to be. The example of |
Hmm, sorry, I wasn't seeing an issue with having "unspecified" and "non-forbidden" be synonymous. I don't think there's a web compatibility concern for templates and strict strings, but are you saying that we should try to ban these even in sloppy non-template strings? I figured it'd be the least surprising to have non-octals allowed just when legacy octals are allowed, but we could certainly consider going further. |
Yeah, if we can get rid of them, we should. I don't care about consistency with numbers. I don't know if implementations are going to be willing to go through the effort of figuring out whether these are necessary for web compatibility or not, though. |
To clarify: the unspecified behavior discussion is only relevant for non-template strings, right? 11.8.6 does say that "A conforming implementation must not use the extended definition of EscapeSequence described in B.1.2 when parsing a TemplateCharacter." This should mean that Annex B discussion isn't relevant for template strings and `\8` should be an error due to the NotEscapeSequence behavior. FWIW, Hermes allows |
@avp Yes I believe that is correct. edit: To be very clear, I just mean untagged templates. Tagged templates have much more freedom with what can follow |
Hmm, so upon investigating further, there are two points worth noting:
It's hard to know for sure just how many pages would break due to (2), but I think it may be wisest to just spec (1) as web reality. 😓 |
I can elaborate on the Web usage of .foo {
color: red;
color: green\9; /* IE9 and older */
} The intention of the |
Wow. |
Currently, JSC bans
\8
(and\9
) in templates and strict strings but SM/V8/XS/Ch all allow it.At first I thought this was simply due to a lack of tests, so I created tc39/test262#2654, but it turns out this has never been specified at all (though it was planned for ES7).
I still view the tests above as the goal, because:
Assuming no one is deeply opposed to this, I'll make a PR and present it at the next meeting.
The text was updated successfully, but these errors were encountered: