fix(mangler): reserve names from eval-containing scopes#18037
Conversation
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.
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
|
17630cd to
c8f847e
Compare
29ad0e5 to
f69b6da
Compare

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