fix corner case in reduce_vars (#3845)

fixes #3844
This commit is contained in:
Alex Lam S.L
2020-05-03 20:30:10 +01:00
committed by GitHub
parent ac429dc8e1
commit ffa1943177
2 changed files with 36 additions and 12 deletions

View File

@@ -7006,3 +7006,30 @@ flatten_iife: {
}
expect_stdout: "PASS"
}
issue_3844: {
options = {
evaluate: true,
reduce_vars: true,
toplevel: true,
}
input: {
console.log(function() {
if (!console) switch (A = 0) {
case console.log("FAIL"):
return;
}
return typeof A;
}());
}
expect: {
console.log(function() {
if (!console) switch (A = 0) {
case console.log("FAIL"):
return;
}
return typeof A;
}());
}
expect_stdout: "undefined"
}