Skip to content

Conversation

@sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Oct 5, 2025

class Outer {
	#shared = 1;
	#getInner() {
		return class {
			#method() {
				return this.#shared;
			}
		};
	}
}

was transformed to

class Outer {
	#e = 1;
	#t() {
		return class {
			#e() {
				return this.#e;
			}
		};
	}
}

. This is wrong because this.#e points the #e method in the inner class rather than the #e in the outer class.
This PR fixes that by avoiding reusing the name used in the outer class.

Copy link
Member Author

sapphi-red commented Oct 5, 2025


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.

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 5, 2025

CodSpeed Performance Report

Merging #14362 will not alter performance

Comparing 10-06-fix_mangler_avoid_reusing_same_mangled_names_in_the_outer_class (c257b41) with main (e605222)1

Summary

✅ 33 untouched
⏩ 4 skipped2

Footnotes

  1. No successful run was found on 10-06-fix_mangler_mangle_private_class_members_in_subsequent_classes_correctly (fc519c8) during the generation of this report, so main (e605222) was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@sapphi-red sapphi-red requested a review from Boshen October 5, 2025 17:23
@sapphi-red sapphi-red marked this pull request as ready for review October 5, 2025 17:24
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Oct 6, 2025
Copy link
Member

Boshen commented Oct 6, 2025

Merge activity

@graphite-app graphite-app bot force-pushed the 10-06-fix_mangler_mangle_private_class_members_in_subsequent_classes_correctly branch from 1171718 to 278df87 Compare October 6, 2025 09:26
graphite-app bot pushed a commit that referenced this pull request Oct 6, 2025
…4362)

```js
class Outer {
	#shared = 1;
	#getInner() {
		return class {
			#method() {
				return this.#shared;
			}
		};
	}
}
```
was transformed to
```js
class Outer {
	#e = 1;
	#t() {
		return class {
			#e() {
				return this.#e;
			}
		};
	}
}
```
. This is wrong because `this.#e` points the #e method in the inner class rather than the #e in the outer class.
This PR fixes that by avoiding reusing the name used in the outer class.
@graphite-app graphite-app bot force-pushed the 10-06-fix_mangler_avoid_reusing_same_mangled_names_in_the_outer_class branch from 572bd52 to 73a8a62 Compare October 6, 2025 09:27
…4362)

```js
class Outer {
	#shared = 1;
	#getInner() {
		return class {
			#method() {
				return this.#shared;
			}
		};
	}
}
```
was transformed to
```js
class Outer {
	#e = 1;
	#t() {
		return class {
			#e() {
				return this.#e;
			}
		};
	}
}
```
. This is wrong because `this.#e` points the #e method in the inner class rather than the #e in the outer class.
This PR fixes that by avoiding reusing the name used in the outer class.
@graphite-app graphite-app bot force-pushed the 10-06-fix_mangler_mangle_private_class_members_in_subsequent_classes_correctly branch from 278df87 to fc519c8 Compare October 6, 2025 09:29
@graphite-app graphite-app bot force-pushed the 10-06-fix_mangler_avoid_reusing_same_mangled_names_in_the_outer_class branch from 73a8a62 to c257b41 Compare October 6, 2025 09:30
Base automatically changed from 10-06-fix_mangler_mangle_private_class_members_in_subsequent_classes_correctly to main October 6, 2025 09:35
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Oct 6, 2025
@graphite-app graphite-app bot merged commit c257b41 into main Oct 6, 2025
27 checks passed
@graphite-app graphite-app bot deleted the 10-06-fix_mangler_avoid_reusing_same_mangled_names_in_the_outer_class branch October 6, 2025 09:36
@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-minifier Area - Minifier C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants