fix dead_code on escaped return assignment (#2693)

fixes #2692
This commit is contained in:
Alex Lam S.L
2017-12-30 15:20:25 +08:00
committed by GitHub
parent d819559a01
commit ed7a0a454e
2 changed files with 30 additions and 4 deletions

View File

@@ -855,3 +855,29 @@ issue_2666: {
}
expect_stdout: "object"
}
issue_2692: {
options = {
dead_code: true,
reduce_vars: false,
}
input: {
function f(a) {
return a = g;
function g() {
return a;
}
}
console.log(typeof f()());
}
expect: {
function f(a) {
return a = g;
function g() {
return a;
}
}
console.log(typeof f()());
}
expect_stdout: "function"
}