fix corner case in functions (#3930)

fixes #3929
This commit is contained in:
Alex Lam S.L
2020-05-28 13:07:36 +01:00
committed by GitHub
parent 7840746bd9
commit d47ea77811
2 changed files with 53 additions and 12 deletions

View File

@@ -4705,3 +4705,44 @@ issue_3911: {
}
expect_stdout: "PASS"
}
issue_3929: {
options = {
functions: true,
reduce_vars: true,
unused: true,
}
input: {
(function() {
var abc = function f() {
(function() {
switch (f) {
default:
var abc = 0;
case 0:
abc.p;
}
console.log(typeof f);
})();
};
typeof abc && abc();
})();
}
expect: {
(function() {
var abc = function f() {
(function() {
switch (f) {
default:
var abc = 0;
case 0:
abc.p;
}
console.log(typeof f);
})();
};
typeof abc && abc();
})();
}
expect_stdout: "function"
}