fix corner case in functions (#3367)

fixes #3366
This commit is contained in:
Alex Lam S.L
2019-04-19 02:55:43 +08:00
committed by GitHub
parent e8a2c0b5bf
commit b55a2fd531
3 changed files with 36 additions and 3 deletions

View File

@@ -2981,3 +2981,34 @@ issue_3364: {
}
expect_stdout: "2"
}
issue_3366: {
options = {
functions: true,
inline: true,
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
function f() {
function g() {
return function() {};
}
var a = g();
(function() {
this && a && console.log("PASS");
})();
}
f();
}
expect: {
(function() {
function a() {}
(function() {
this && a && console.log("PASS");
})();
})();
}
expect_stdout: "PASS"
}