fix corner cases in pure_getters & reduce_vars (#5859)

fixes #5856
fixes #5857
fixes #5858
This commit is contained in:
Alex Lam S.L
2024-06-20 17:43:55 +03:00
committed by GitHub
parent 8195a664fd
commit 95d3ede664
4 changed files with 82 additions and 17 deletions

View File

@@ -617,3 +617,33 @@ issue_5292_sub_pure_getters_strict: {
]
node_version: ">=14"
}
issue_5856: {
options = {
pure_getters: "strict",
reduce_vars: true,
side_effects: true,
}
input: {
try {
var a;
a?.p;
a.q;
console.log("FAIL");
} catch (e) {
console.log("PASS");
}
}
expect: {
try {
var a;
a?.p;
a.q;
console.log("FAIL");
} catch (e) {
console.log("PASS");
}
}
expect_stdout: "PASS"
node_version: ">=14"
}