fix variable scope determination (#3449)

fixes #3444
This commit is contained in:
Alex Lam S.L
2019-10-06 05:13:44 +08:00
committed by GitHub
parent bde7418ce1
commit a31c477fea
2 changed files with 36 additions and 3 deletions

View File

@@ -3148,3 +3148,30 @@ issue_3402: {
"function",
]
}
issue_3444: {
options = {
inline: true,
reduce_vars: true,
unused: true,
}
input: {
(function(h) {
return f;
function f() {
g();
}
function g() {
h("PASS");
}
})(console.log)();
}
expect: {
(function(h) {
return function() {
void h("PASS");
};
})(console.log)();
}
expect_stdout: "PASS"
}