Skip to content

rescan gt token at the end of type args parsing#15631

Merged
nicolo-ribaudo merged 1 commit intobabel:mainfrom
JLHwung:fix-15628
May 17, 2023
Merged

rescan gt token at the end of type args parsing#15631
nicolo-ribaudo merged 1 commit intobabel:mainfrom
JLHwung:fix-15628

Conversation

@JLHwung
Copy link
Contributor

@JLHwung JLHwung commented May 16, 2023

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

This PR fixes an edge case where >= is incorrectly parsed as > and = at the boundary between type arguments and non-type js expressions. The token > is parsed in previous node.params when inType is true. Here we should reset the tokenizer and rescan the token.

@JLHwung JLHwung added PR: Bug Fix 🐛 A type of pull request used for our changelog categories pkg: parser area: typescript labels May 16, 2023
@babel-bot
Copy link
Collaborator

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

@nicolo-ribaudo nicolo-ribaudo merged commit c5f68eb into babel:main May 17, 2023
@nicolo-ribaudo nicolo-ribaudo deleted the fix-15628 branch May 17, 2023 07:37
@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 17, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area: typescript outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser 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.

[Bug]: x < y >= z is incorrectly considered an assignment expression in TypeScript

5 participants