fix corner case in collapse_vars (#5513)

fixes #5512
This commit is contained in:
Alex Lam S.L
2022-06-13 00:55:15 +01:00
committed by GitHub
parent b6f250f5c9
commit 4382bfe848
2 changed files with 46 additions and 11 deletions

View File

@@ -3300,3 +3300,33 @@ issue_5504: {
expect_stdout: "undefined"
node_version: ">=12"
}
issue_5512: {
options = {
collapse_vars: true,
}
input: {
"use strict";
a = "PASS";
class A {
static {
console.log(a);
}
static p = "PASS";
}
var a;
}
expect: {
"use strict";
a = "PASS";
class A {
static {
console.log(a);
}
static p = "PASS";
}
var a;
}
expect_stdout: "PASS"
node_version: ">=16"
}