retain recursive function names (#2667)

fixes #2665
This commit is contained in:
Alex Lam S.L
2017-12-27 07:00:12 +08:00
committed by GitHub
parent 3ff625de7e
commit 5205dbcbf4
2 changed files with 42 additions and 3 deletions

View File

@@ -1488,3 +1488,37 @@ issue_2660_2: {
}
expect_stdout: "0"
}
issue_2665: {
options = {
evaluate: true,
inline: true,
keep_fargs: false,
passes: 2,
reduce_funcs: true,
reduce_vars: true,
side_effects: true,
toplevel: true,
typeofs: true,
unused: true,
}
input: {
var a = 1;
function g() {
a-- && g();
}
typeof h == "function" && h();
function h() {
typeof g == "function" && g();
}
console.log(a);
}
expect: {
var a = 1;
!function g() {
a-- && g();
}();
console.log(a);
}
expect_stdout: "-1"
}