Skip to content
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(es/minifier): should preserve classes with side effects in static fields #6480

Merged
merged 3 commits into from Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,2 +1,14 @@
//// [classStaticBlock15.ts]
console.log(void 0);
var _C__1;
class C {
static #_1 = 1;
static #_3 = 3;
static #_5 = 5;
static{}
static{}
static{}
static{}
static{}
static{}
}
console.log(_C__1);
@@ -1,6 +1,11 @@
//// [classStaticBlock23.ts]
[
const nums = [
1,
2,
3
].map((n)=>Promise.resolve(n));
class C {
static{
for await (let nn of nums)console.log(nn);
}
}
@@ -1,2 +1,12 @@
//// [classStaticBlock5.ts]
super.a;
class B {
static a = 1;
static b = 2;
}
class C extends B {
static b = 3;
static c = super.a;
static{
this.b, super.b, super.a;
}
}
@@ -1,2 +1,10 @@
//// [classStaticBlockUseBeforeDef1.ts]
this.x;
class C {
static{
this.x = 1;
}
static y = this.x;
static{
this.z = this.y;
}
}
@@ -1 +1,6 @@
//// [classStaticBlockUseBeforeDef2.ts]
class C {
static{
this.x = 1;
}
}
@@ -1 +1,13 @@
//// [privateNameComputedPropertyName4.ts]
class C1 {
static #qux = 42;
bar() {}
}
class C2 {
static #qux = 42;
static bar() {}
}
class C3 {
static #qux = 42;
static bar = "test";
}