Remove errors for invalid escape sequences in tagged template literals#41030
Closed
uhyo wants to merge 6 commits intomicrosoft:mainfrom
Closed
Remove errors for invalid escape sequences in tagged template literals#41030uhyo wants to merge 6 commits intomicrosoft:mainfrom
uhyo wants to merge 6 commits intomicrosoft:mainfrom
Conversation
Closed
Contributor
Author
|
Happy new financial year (in Japan)!! 🌸🥳 |
elibarzilay
suggested changes
Jun 3, 2021
Contributor
There was a problem hiding this comment.
I don't think that this is a good approach since it complicates the template parsing code (and only when tags are used?) but it can be simpler to handle all strings in one place instead since they all go through the same place. I posted a comment listing how this can be done.
(Oh, I'm guessing that the tag thing is to deal with raw-tagged strings (#42887); in any case, I think that it's better to fix that case after dealing with the general string case.)
Contributor
Author
|
Thank you for your reviews! |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Happy hacktoberfest! 🎃🥳
Fixes #39715.
Also gives a partial fix to #396.
Example
Code
Current Behavior
New Behavior
(Error disappeared from tagged template literal, and new error for octal escape sequence in untagged template literal)
Implementation Detail
With this PR, invalid escape sequences do not emit errors when they are first scanned. Untagged template literals with invalid escape sequence in it are re-scanned to emit syntax errors.