fix corner case in unused (#5323)

fixes #5322
This commit is contained in:
Alex Lam S.L
2022-01-29 11:28:19 +00:00
committed by GitHub
parent 28943bcebb
commit e7d6dd2ea2
2 changed files with 48 additions and 13 deletions

View File

@@ -2449,3 +2449,30 @@ issue_5294_4: {
expect_stdout: "PASS"
node_version: ">=12"
}
issue_5322: {
options = {
toplevel: true,
unused: true,
}
input: {
var a = 41;
class A {
static p() {
console.log(++a);
}
static q = this.p();
}
}
expect: {
var a = 41;
(class {
static p() {
console.log(++a);
}
static q = this.p();
});
}
expect_stdout: "42"
node_version: ">=12"
}