handle RHS side-effects in collapse_vars (#3097)

fixes #3096
This commit is contained in:
Alex Lam S.L
2018-04-24 20:31:50 +08:00
committed by GitHub
parent b5ce199711
commit 27211cf2d5
2 changed files with 68 additions and 41 deletions

View File

@@ -5327,3 +5327,24 @@ issue_3032: {
}
expect_stdout: "42"
}
issue_3096: {
options = {
collapse_vars: true,
}
input: {
console.log(function() {
var ar = ["a", "b"];
var first = ar.pop();
return ar + "" + first;
}());
}
expect: {
console.log(function() {
var ar = ["a", "b"];
var first = ar.pop();
return ar + "" + first;
}());
}
expect_stdout: "ab"
}