You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When processing strict mode code, the syntax of NumericLiteral must not be extended to include LegacyOctalIntegerLiteral and the syntax of DecimalIntegerLiteral must not be extended to include NonOctalDecimalIntegerLiteral as described in B.1.1.
but it doesn't have an entry saying:
When processing strict mode code, the syntax of EscapeSequence must not be extended to include LegacyOctalEscapeSequence or NonOctalDecimalEscapeSequence as defined in B.1.2.
This seems to indicate that it's okay for an implementation to provide the latter as an extension. I'm thinking this is probably an oversight (going back to ES6). Is it?
Background: B.1.1 and B.1.2 are otherwise fairly similar in terms of what's allowed and what's disallowed. Specifically:
A conforming implementation, when processing strict mode code, must not extend, as described in B.1.1, the syntax of NumericLiteral to include LegacyOctalIntegerLiteral, nor extend the syntax of DecimalIntegerLiteral to include NonOctalDecimalIntegerLiteral.
A conforming implementation, when processing strict mode code, must not extend the syntax of EscapeSequence to include LegacyOctalEscapeSequence or NonOctalDecimalEscapeSequence as described in B.1.2.
The syntax and semantics of 12.8.4 is extended as follows except that this extension is not allowed for strict mode code
At which point, you might think "Isn't it pretty obvious then? They're both not allowed in strict mode code." However, I think this just means that these things are not allowed in what you might call a "baseline" or "minimal" implementation. But 17 Error Handling and Language Extensions gives implementations a lot of leeway to add extensions, as long as they aren't explicitly forbidden in 17.1. So it's odd that 17.1 would forbid (as an extension) B.1.1 in strict mode code, but not B.1.2 in strict mode code.
The text was updated successfully, but these errors were encountered:
On the other hand, maybe the anomaly in 17.1 isn't the absence of B.1.2, but the presence of B.1.1.
E.g., if you look at C The Strict Mode of ECMAScript and compare it to 17.1 Forbidden Extensions, the only thing that's clearly in both lists is B.1.1. (They also both have one about function properties named "caller" or "arguments", but they seem to be saying different things.) That is, almost all of the things that strict mode disallows are not explicitly forbidden as extensions. So then it's odd that one of them is.
The editors feel this is something worth addressing and something that would require confirmation of intent from the committee, however it is not a very high priority for any of us at this moment, and none of us plan to bring this topic to committee in the near future.
Working on PR #1867, I've been looking at 17.1 Forbidden Extensions, and I noticed that, it does have an entry saying:
but it doesn't have an entry saying:
This seems to indicate that it's okay for an implementation to provide the latter as an extension. I'm thinking this is probably an oversight (going back to ES6). Is it?
Background: B.1.1 and B.1.2 are otherwise fairly similar in terms of what's allowed and what's disallowed. Specifically:
12.8.3 Numeric Literals says:
and 12.8.4 String Literals says:
(These sentences are both repeated in Annex C.)
Similarly, B.1.1 Numeric Literals says:
and B.1.2 String Literals says:
At which point, you might think "Isn't it pretty obvious then? They're both not allowed in strict mode code." However, I think this just means that these things are not allowed in what you might call a "baseline" or "minimal" implementation. But 17 Error Handling and Language Extensions gives implementations a lot of leeway to add extensions, as long as they aren't explicitly forbidden in 17.1. So it's odd that 17.1 would forbid (as an extension) B.1.1 in strict mode code, but not B.1.2 in strict mode code.
The text was updated successfully, but these errors were encountered: