fix corner case in collapse_vars (#4206)

fixes #4205
This commit is contained in:
Alex Lam S.L
2020-10-12 18:30:21 +01:00
committed by GitHub
parent 4d33cb2f94
commit 9272f662c0
2 changed files with 47 additions and 2 deletions

View File

@@ -872,3 +872,40 @@ issue_4202: {
}
expect_stdout: "42"
}
issue_4205: {
options = {
collapse_vars: true,
}
input: {
var a = function(b) {
var c = function() {
switch (0) {
case a:
return 0;
case b:
case console.log("PASS"):
}
}();
{
const b = c;
}
}();
}
expect: {
var a = function(b) {
var c = function() {
switch (0) {
case a:
return 0;
case b:
case console.log("PASS"):
}
}();
{
const b = c;
}
}();
}
expect_stdout: true
}