Skip to content

Conversation

@sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Sep 28, 2025

fixes #14209
refs #14027

@github-actions github-actions bot added A-minifier Area - Minifier A-codegen Area - Code Generation C-bug Category - Bug labels Sep 28, 2025
Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@sapphi-red sapphi-red marked this pull request as ready for review September 28, 2025 17:08
Copilot AI review requested due to automatic review settings September 28, 2025 17:08
Copy link
Contributor

Copilot AI left a 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 private class members used in nested classes were not being mangled properly. The fix ensures that when generating code for private identifiers, the mangler searches through all enclosing class scopes (from innermost to outermost) to find the correct mangled name, rather than only looking at the current class scope.

  • Updates the private identifier code generation to search through all enclosing class scopes
  • Adds test cases for nested classes that access outer class private members and handle name shadowing

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
crates/oxc_codegen/src/gen.rs Modified private identifier generation to search through all enclosing class scopes
crates/oxc_minifier/tests/mangler/mod.rs Added test cases for nested classes with private member access
crates/oxc_minifier/tests/mangler/snapshots/private_member_mangling.snap Updated test snapshots with expected output for new test cases

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@sapphi-red sapphi-red requested a review from Boshen September 28, 2025 17:09
@codspeed-hq
Copy link

codspeed-hq bot commented Sep 28, 2025

CodSpeed Instrumentation Performance Report

Merging #14218 will not alter performance

Comparing 09-29-fix_mangler_mangle_private_class_members_used_in_nested_classes_properly (b83ffe5) with main (653aa8a)1

Summary

✅ 37 untouched

Footnotes

  1. No successful run was found on main (b83ffe5) during the generation of this report, so 653aa8a was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Oct 1, 2025
Copy link
Member

Boshen commented Oct 1, 2025

Merge activity

@graphite-app graphite-app bot force-pushed the 09-29-fix_mangler_mangle_private_class_members_used_in_nested_classes_properly branch from 7b2ca9f to b83ffe5 Compare October 1, 2025 04:54
@graphite-app graphite-app bot merged commit b83ffe5 into main Oct 1, 2025
26 checks passed
@graphite-app graphite-app bot deleted the 09-29-fix_mangler_mangle_private_class_members_used_in_nested_classes_properly branch October 1, 2025 05:00
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Oct 1, 2025
@Boshen Boshen mentioned this pull request Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-codegen Area - Code Generation A-minifier Area - Minifier C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inner classes don't inherit private class member mangling

3 participants