Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(parser): prevent line increments for U+2028/U+2029 in tokenizer#17602

Open
SHARMA1525 wants to merge 1 commit intobabel:mainfrom
SHARMA1525:fix-u2028-line-tracking
Open

fix(parser): prevent line increments for U+2028/U+2029 in tokenizer#17602
SHARMA1525 wants to merge 1 commit intobabel:mainfrom
SHARMA1525:fix-u2028-line-tracking

Conversation

@SHARMA1525
Copy link

Bug Fix: Correct Line Tracking for \u2028 / \u2029 Inside String Escapes

Babel was incorrectly tracking line numbers when a string literal contained
Unicode line terminator escapes (\u2028, \u2029).
Although these characters appear inside an escape sequence, the ECMAScript
spec defines them as actual line terminators in source text.

Problem Example

("\\\u2028");
X;

@babel-bot
Copy link
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/60204

@liuxingbaoyu
Copy link
Member

Thank you for your contribution! We discussed it in #17395, but we didn't get a definitive result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants