enhance dead_code (#3551)

This commit is contained in:
Alex Lam S.L
2019-10-30 06:34:54 +08:00
committed by GitHub
parent 0f4cfa877a
commit f1eb03f2c0
3 changed files with 95 additions and 17 deletions

View File

@@ -2187,3 +2187,37 @@ issue_3515_3: {
}
expect_stdout: "PASS"
}
function_assign: {
options = {
pure_getters: "strict",
reduce_vars: true,
side_effects: true,
unused: true,
}
input: {
console.log(function() {
var a = "PASS";
function g(b) {
return b;
}
g.p = a;
function h(c) {
return c;
}
h.p = a;
return h;
}().p);
}
expect: {
console.log(function() {
var a = "PASS";
function h(c) {
return c;
}
h.p = a;
return h;
}().p);
}
expect_stdout: "PASS"
}