fix dead_code on return assignments (#2668)

fixes #2666
This commit is contained in:
Alex Lam S.L
2017-12-27 07:40:34 +08:00
committed by GitHub
parent 5205dbcbf4
commit f30790b11b
2 changed files with 48 additions and 1 deletions

View File

@@ -828,3 +828,30 @@ issue_2597: {
}
expect_stdout: "PASS"
}
issue_2666: {
options = {
dead_code: true,
}
input: {
function f(a) {
return a = {
p: function() {
return a;
}
};
}
console.log(typeof f().p());
}
expect: {
function f(a) {
return a = {
p: function() {
return a;
}
};
}
console.log(typeof f().p());
}
expect_stdout: "object"
}