drop anonymous function name when overshadowed by other declarations (#1712)

fixes #1709
This commit is contained in:
Alex Lam S.L
2017-03-28 17:02:20 +08:00
committed by GitHub
parent 65da9acce6
commit fb177a6312
2 changed files with 46 additions and 3 deletions

View File

@@ -805,3 +805,42 @@ issue_1656: {
}
expect_exact: "for (;;) ;"
}
issue_1709: {
options = {
unused: true,
}
input: {
console.log(
function x() {
var x = 1;
return x;
}(),
function y() {
const y = 2;
return y;
}(),
function z() {
function z() {}
return z;
}()
);
}
expect: {
console.log(
function() {
var x = 1;
return x;
}(),
function() {
const y = 2;
return y;
}(),
function() {
function z() {}
return z;
}()
);
}
expect_stdout: true
}