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
When reading a new string, U+2028/2029 should correctly set the new column #10944
Conversation
@@ -0,0 +1,2 @@ | |||
(`before after`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The behaviour of U+2028 in string template is not changed. Adding test here for coverage.
}, | ||
"end": { | ||
"line": 2, | ||
"column": 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep in mind that the loc
here should equals to that of packages/babel-parser/test/fixtures/es2019/json-strings/string-paragraph-separator/output.json
.
As a follow-up to #8866, this PR fixes when the tokenizer reading a string, it does not update the
lineStart
after U+2028/2029 is read. Note that thelineStart
is correctly updated when reading a template tokenbabel/packages/babel-parser/src/tokenizer/index.js
Line 1229 in b91720c
So I consider it as a bug fix to unify the different behaviour here.