fix corner case in collapse_vars (#5395)

fixes #5394
This commit is contained in:
Alex Lam S.L
2022-03-29 18:22:57 +01:00
committed by GitHub
parent 8922f08fbf
commit e3d328f741
2 changed files with 27 additions and 2 deletions

View File

@@ -9925,3 +9925,25 @@ issue_5309_2: {
}
expect_stdout: "PASS"
}
issue_5394: {
options = {
collapse_vars: true,
evaluate: true,
}
input: {
try {
throw A.p = (console.log("FAIL"), []), !1;
} catch (e) {
console.log(typeof e);
}
}
expect: {
try {
throw !(A.p = (console.log("FAIL"), []));
} catch (e) {
console.log(typeof e);
}
}
expect_stdout: "object"
}