fix corner case in merge_vars (#4254)

fixes #4253
This commit is contained in:
Alex Lam S.L
2020-11-01 02:37:21 +00:00
committed by GitHub
parent d8563caba7
commit cbf7269296
2 changed files with 56 additions and 15 deletions

View File

@@ -3092,3 +3092,35 @@ issue_4237_2: {
}
expect_stdout: "PASS"
}
issue_4253: {
options = {
merge_vars: true,
toplevel: true,
}
input: {
switch (0) {
default:
var a = "FAIL";
a = a && a;
try {
break;
} catch (e) {}
var b = 42;
}
console.log(b);
}
expect: {
switch (0) {
default:
var a = "FAIL";
a = a && a;
try {
break;
} catch (e) {}
var b = 42;
}
console.log(b);
}
expect_stdout: "undefined"
}