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

Skip to content

polish(parser): improve ImportExpression error recovery#17902

Merged
JLHwung merged 6 commits into
babel:mainfrom
JLHwung:improve-import-expression-errory-recovery
Apr 19, 2026
Merged

polish(parser): improve ImportExpression error recovery#17902
JLHwung merged 6 commits into
babel:mainfrom
JLHwung:improve-import-expression-errory-recovery

Conversation

@JLHwung
Copy link
Copy Markdown
Contributor

@JLHwung JLHwung commented Mar 25, 2026

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

In this PR we improve the error recovery capacity when parsing ImportExpression. Previously in Babel 7 we parsed the import expressions as a CallExpression[callee=Import] node and emit such errors.

This PR also prints the phase of an ImportExpression in the error message.

@JLHwung JLHwung added PR: Polish 💅 A type of pull request used for our changelog categories pkg: parser labels Mar 25, 2026
@babel-bot
Copy link
Copy Markdown
Collaborator

babel-bot commented Mar 25, 2026

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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Mar 25, 2026

Open in StackBlitz

commit: eaf95cd

@JLHwung JLHwung merged commit ed4a811 into babel:main Apr 19, 2026
56 checks passed
@JLHwung JLHwung deleted the improve-import-expression-errory-recovery branch April 19, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: parser PR: Polish 💅 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants