fix corner case in functions (#4260)

fixes #4259
This commit is contained in:
Alex Lam S.L
2020-11-05 19:55:25 +00:00
committed by GitHub
parent af4ea3ff69
commit c2f6fd5fde
3 changed files with 39 additions and 14 deletions

View File

@@ -5115,3 +5115,29 @@ issue_4233: {
}
expect_stdout: "number"
}
issue_4259: {
options = {
collapse_vars: true,
functions: true,
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
var a = function b() {
var c = b;
for (b in c);
};
a();
console.log(typeof a);
}
expect: {
function a() {
for (a in a);
}
a();
console.log(typeof a);
}
expect_stdout: "function"
}

View File

@@ -1999,7 +1999,7 @@ issue_1606: {
var a, b;
function g(){};
b = 2;
x(b);
x(2);
}
}
}