-
-
Notifications
You must be signed in to change notification settings - Fork 721
Labels
A-minifierArea - MinifierArea - Minifier
Description
refs #14218
When there are two classes (without nesting), the second one uses the private member mapping of the first one. Therefore, private member mangling is generally broken, except in the test, which uses the same private identifier for both classes. When changing the second private identifier, the second class is not mangled:
--- a/crates/oxc_minifier/tests/mangler/snapshots/private_member_mangling.snap
+++ b/crates/oxc_minifier/tests/mangler/snapshots/private_member_mangling.snap
@@ -95,7 +96,7 @@ class Foo {
}
}
-class A { #field = 1; #method() { return this.#field; } } class B { #field = 2; #method() { return this.#field; } }
+class A { #field = 1; #method() { return this.#field; } } class B { #field2 = 2; #method() { return this.#field2; } }
class A {
#e = 1;
#t() {
@@ -103,8 +104,8 @@ class A {
}
}
class B {
- #e = 2;
+ #field2 = 2;
#t() {
- return this.#e;
+ return this.#field2;
}
}
Metadata
Metadata
Assignees
Labels
A-minifierArea - MinifierArea - Minifier