-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Showing
1 changed file
with
98 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters