fix(parser): avoid duplicate exports during TLA reparse#22524
Closed
camc314 wants to merge 1 commit into
Closed
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a false Duplicated export diagnostic triggered in unambiguous (.js) parsing when a statement containing an ambiguous await token is reparsed with top-level-await context enabled, by preventing module-record side effects from being recorded during that reparse pass.
Changes:
- Prevent module record import/export side effects from being duplicated during the unambiguous top-level-await reparse.
- Add a misc coverage fixture reproducing the
.jsauto-detect duplicate-export case and update coverage snapshots accordingly.
Reviewed changes
Copilot reviewed 1 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| crates/oxc_parser/src/lib.rs | Temporarily swaps out module_record_builder during the top-level-await reparse loop to avoid duplicate module-record side effects. |
| tasks/coverage/misc/pass/oxc-22158.js | Adds a regression fixture for the .js unambiguous + export var x = await + 1 case. |
| tasks/coverage/snapshots/parser_misc.snap | Updates parser misc coverage counts after adding the new fixture. |
| tasks/coverage/snapshots/semantic_misc.snap | Updates semantic misc coverage counts after adding the new fixture. |
| tasks/coverage/snapshots/transformer_misc.snap | Updates transformer misc coverage counts after adding the new fixture. |
| tasks/coverage/snapshots/formatter_misc.snap | Updates formatter misc coverage counts after adding the new fixture. |
| tasks/coverage/snapshots/codegen_misc.snap | Updates codegen misc coverage counts after adding the new fixture. |
Member
|
closed by #22684 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
.jsauto-detect false duplicate export case.fixes #22158
closes #22520