-
-
Notifications
You must be signed in to change notification settings - Fork 788
fix(mangler): reserve names from eval-containing scopes #18037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: c/01-15-fix_minifier_preserve_return_value_of___pure___iife_in_return_statements
Are you sure you want to change the base?
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a bug where the mangler could incorrectly shadow variables from scopes containing eval() calls. The fix ensures that variable names from eval-containing scopes are reserved and not reused as mangled names in other scopes.
Changes:
- Added collection of reserved names from eval-containing scopes during slot assignment
- Updated name generation to check against eval-reserved names to prevent shadowing
- Added comprehensive test cases covering various eval scenarios
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/oxc_mangler/src/lib.rs | Implements eval-reserved name tracking by collecting variable names from eval scopes and excluding them from the mangled name pool |
| crates/oxc_minifier/tests/mangler/mod.rs | Adds helper test function and new test cases to verify correct behavior with eval in various scope configurations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cc2e0cc to
29ad0e5
Compare
Merge activity
|

fixes #17956
Refs: rolldown/rolldown#7843, rolldown/rolldown#7848