fix corner case in evaluate & reduce_vars (#4423)

fixes #4422
This commit is contained in:
Alex Lam S.L
2020-12-19 21:47:15 +00:00
committed by GitHub
parent 87cf715213
commit 8ce3c7d70f
2 changed files with 31 additions and 1 deletions

View File

@@ -3094,3 +3094,26 @@ issue_4393: {
}
expect_stdout: "PASS"
}
issue_4422: {
options = {
evaluate: true,
reduce_vars: true,
unused: true,
}
input: {
console.log(function f(a) {
a = "FAIL 1";
arguments[0] = "PASS";
return a;
}("FAIL 2"));
}
expect: {
console.log(function(a) {
a = "FAIL 1";
arguments[0] = "PASS";
return a;
}("FAIL 2"));
}
expect_stdout: "PASS"
}