Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Normative: Make B.1.2 "String Literals" normative.
(Part of Annex B reform, see PR #1595.) This one was trickier than B.1.1 B.1.2's extension isn't simply to add a production to the grammar (AKA add another right-hand-side to an existing production). Instead it *replaces* a production/alternative with something more general. So, when it comes to strict mode disallowing the general syntax, we can't simply say that the general production is a Syntax Error in strict mode, because strict mode still has to allow the restricted syntax. Instead, we say that if we're in strict mode code (or a TemplateLiteral), an instance of the new production is a Syntax Error *unless* it's an instance of the restricted syntax. To express the latter condition, we use the cover grammar machinery. (It could be done in other ways, but I think this is clearest.)
- Loading branch information