fix corner cases in functions & merge_vars (#4156)

fixes #4155
This commit is contained in:
Alex Lam S.L
2020-09-26 08:31:33 +01:00
committed by GitHub
parent 9882a9f4af
commit b4ff6d0f2d
3 changed files with 75 additions and 2 deletions

View File

@@ -4777,3 +4777,34 @@ issue_4006: {
}
expect_stdout: "-1"
}
issue_4155: {
options = {
functions: true,
inline: true,
merge_vars: true,
reduce_vars: true,
unused: true,
}
input: {
(function() {
var a;
(function() {
console.log(a);
})(a);
var b = function() {};
b && console.log(typeof b);
})();
}
expect: {
(function() {
void console.log(b);
var b = function() {};
b && console.log(typeof b);
})();
}
expect_stdout: [
"undefined",
"function",
]
}