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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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);
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
@@ -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;
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
//// [classStaticBlockUseBeforeDef1.ts]
this.x;
class C {
static{
this.x = 1;
}
static y = this.x;
static{
this.z = this.y;
}
}
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
//// [classStaticBlockUseBeforeDef2.ts]
class C {
static{
this.x = 1;
}
}
Original file line number Diff line number Diff line change
@@ -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";
}
Loading