fix corner case in pure_getters (#4877)

fixes #4876
This commit is contained in:
Alex Lam S.L
2021-04-27 15:52:37 +01:00
committed by GitHub
parent 4cccc01f3e
commit a06e20304b
2 changed files with 35 additions and 3 deletions

View File

@@ -672,3 +672,32 @@ issue_4827_3: {
expect_stdout: "undefined"
node_version: ">=15"
}
issue_4876: {
options = {
pure_getters: "strict",
reduce_vars: true,
side_effects: true,
toplevel: true,
}
input: {
try {
var a = null;
var b = a &&= 42;
b.p;
} catch (e) {
console.log("PASS");
}
}
expect: {
try {
var a = null;
var b = a &&= 42;
b.p;
} catch (e) {
console.log("PASS");
}
}
expect_stdout: "PASS"
node_version: ">=15"
}