diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-06-13 13:29:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-13 20:29:14 +0800 |
commit | 6fc7a2ab6a9523a8da1962ba8701bd28f11e417c (patch) | |
tree | 5e290e7ba3a89651004390805e5b8a34926db512 /test/compress | |
parent | f8b2215145819ed104ba0be0fd5a6f951c91ef8a (diff) | |
download | tracifyjs-6fc7a2ab6a9523a8da1962ba8701bd28f11e417c.tar.gz tracifyjs-6fc7a2ab6a9523a8da1962ba8701bd28f11e417c.zip |
fix corner case in `side_effects` (#5002)
fixes #5001
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/awaits.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/compress/awaits.js b/test/compress/awaits.js index 28558bd2..f27fb599 100644 --- a/test/compress/awaits.js +++ b/test/compress/awaits.js @@ -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" +} |