-
-
Notifications
You must be signed in to change notification settings - Fork 721
fix(mangler): mangle private class members in subsequent classes correctly #14361
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
fix(mangler): mangle private class members in subsequent classes correctly #14361
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. |
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 private class member mangling in subsequent classes by changing from a linear Vec-based approach to using IndexVec with ClassId for proper class tracking during code generation.
- Replaces Vec with IndexVec<ClassId, FxHashMap> for class private member mappings
- Updates the class tracking mechanism in codegen to use a proper stack with ClassId identifiers
- Fixes the private identifier lookup to correctly find mangled names across nested class scopes
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/oxc_mangler/src/lib.rs | Changes return type from Vec to IndexVec for class private mappings |
| crates/oxc_mangler/Cargo.toml | Adds oxc_index dependency for IndexVec support |
| crates/oxc_codegen/src/lib.rs | Updates class tracking with proper ClassId-based stack implementation |
| crates/oxc_codegen/src/gen.rs | Fixes private identifier lookup to correctly iterate through class hierarchy |
| crates/oxc_minifier/tests/mangler/mod.rs | Adds test case for different private member names across classes |
| crates/oxc_minifier/tests/mangler/snapshots/private_member_mangling.snap | Test snapshot showing correct mangling output |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
CodSpeed Performance ReportMerging #14361 will not alter performanceComparing Summary
Footnotes |
Merge activity
|
1171718 to
278df87
Compare
278df87 to
fc519c8
Compare

fixes #14342