fix corner case in side_effects (#5002)

fixes #5001
This commit is contained in:
Alex Lam S.L
2021-06-13 13:29:14 +01:00
committed by GitHub
parent f8b2215145
commit 6fc7a2ab6a
2 changed files with 38 additions and 5 deletions

View File

@@ -1758,3 +1758,25 @@ issue_4987: {
]
node_version: ">=8"
}
issue_5001: {
options = {
awaits: true,
inline: true,
side_effects: true,
}
input: {
var a = 0;
(async function() {
a++ | await 42;
})();
console.log(a ? "PASS" : "FAIL");
}
expect: {
var a = 0;
void a++;
console.log(a ? "PASS" : "FAIL");
}
expect_stdout: "PASS"
node_version: ">=8"
}