fix corner case in reduce_vars (#5051)

fixes #5050
This commit is contained in:
Alex Lam S.L
2021-07-05 04:57:58 +01:00
committed by GitHub
parent f5dbb672b9
commit 6961c57d1e
2 changed files with 44 additions and 21 deletions

View File

@@ -7696,3 +7696,32 @@ issue_5048: {
}
expect_stdout: "undefined"
}
issue_5050: {
options = {
evaluate: true,
reduce_vars: true,
toplevel: true,
}
input: {
function f() {
console.log(a);
}
this;
var a = 1;
f(console.log(2), f(), a = 3);
}
expect: {
function f() {
console.log(a);
}
this;
var a = 1;
f(console.log(2), f(), a = 3);
}
expect_stdout: [
"2",
"1",
"3",
]
}