handle case correctly under reduce_vars (#2993)

fixes #2992
This commit is contained in:
Alex Lam S.L
2018-03-11 15:54:43 +08:00
committed by GitHub
parent fc6ebd04a5
commit b9f72a4a81
2 changed files with 45 additions and 6 deletions

View File

@@ -5545,3 +5545,33 @@ issue_2919: {
}
expect_stdout: "function"
}
issue_2992: {
options = {
evaluate: true,
reduce_vars: true,
}
input: {
var c = "PASS";
(function f(b) {
switch (0) {
case 0:
case b = 1:
b && (c = "FAIL");
}
})();
console.log(c);
}
expect: {
var c = "PASS";
(function f(b) {
switch (0) {
case 0:
case b = 1:
b && (c = "FAIL");
}
})();
console.log(c);
}
expect_stdout: "PASS"
}