Skip to content

fix(parser): Terminate modifier parsing at newline#17307

Merged
nicolo-ribaudo merged 3 commits intobabel:mainfrom
magic-akari:fix/issue-17305
May 13, 2025
Merged

fix(parser): Terminate modifier parsing at newline#17307
nicolo-ribaudo merged 3 commits intobabel:mainfrom
magic-akari:fix/issue-17305

Conversation

@magic-akari
Copy link
Copy Markdown
Contributor

Q                       A
Fixed Issues? Fixes: #17305
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

@babel-bot
Copy link
Copy Markdown
Collaborator

babel-bot commented May 13, 2025

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

@nicolo-ribaudo nicolo-ribaudo added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label May 13, 2025
Copy link
Copy Markdown
Contributor

@JLHwung JLHwung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

});
}

if (this.hasPrecedingLineBreak()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already check the newline in tsNextTokenCanFollowModifier, but somehow we missed this check for the static token, could you move the newline check there? So we don't have to check the line break for every other modifiers here.

Copy link
Copy Markdown
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@nicolo-ribaudo nicolo-ribaudo merged commit 205e1cf into babel:main May 13, 2025
56 checks passed
@github-actions github-actions Bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Aug 13, 2025
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 13, 2025
@magic-akari magic-akari deleted the fix/issue-17305 branch December 28, 2025 16:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Bug Fix 🐛 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't parse a speical class when ts plugin enabled

4 participants