Skip to content
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

Merged
merged 2 commits into from Jan 3, 2020

Conversation

@JLHwung
Copy link
Contributor

JLHwung commented Dec 30, 2019

Q                       A
Fixed Issues? Fixes #10435
Patch: Bug Fix? Yes
Tests Added + Pass? Yes
License MIT

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 the lineStart is correctly updated when reading a template token

this.state.lineStart = this.state.pos;

So I consider it as a bug fix to unify the different behaviour here.

@@ -0,0 +1,2 @@
(`before
after`);

This comment has been minimized.

Copy link
@JLHwung

JLHwung Dec 30, 2019

Author Contributor

The behaviour of U+2028 in string template is not changed. Adding test here for coverage.

},
"end": {
"line": 2,
"column": 8

This comment has been minimized.

Copy link
@JLHwung

JLHwung Dec 30, 2019

Author Contributor

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.

@nicolo-ribaudo nicolo-ribaudo merged commit 467667a into babel:master Jan 3, 2020
4 of 5 checks passed
4 of 5 checks passed
build (13.x)
Details
test262 Workflow: test262
Details
Travis CI - Pull Request Build Passed
Details
build-standalone Workflow: build-standalone
Details
e2e Workflow: e2e
Details
@nicolo-ribaudo nicolo-ribaudo deleted the JLHwung:fix-10435 branch Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants
You can’t perform that action at this time.