fix corner case in reduce_vars (#3378)

fixes #3377
This commit is contained in:
Alex Lam S.L
2019-04-24 14:01:01 +08:00
committed by GitHub
parent a84beafd1b
commit dafed54764
2 changed files with 21 additions and 3 deletions

View File

@@ -6737,3 +6737,21 @@ drop_side_effect_free: {
}
expect_stdout: "123"
}
issue_3377: {
options = {
reduce_vars: true,
unused: true,
}
input: {
console.log(function f() {
return f[0], (f = 42);
}());
}
expect: {
console.log(function f() {
return f[0], (f = 42);
}());
}
expect_stdout: "42"
}