diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-03-02 09:39:34 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-02 17:39:34 +0800 |
commit | b1e05fd48afd9aceaa00cc621a8f6ac22c097398 (patch) | |
tree | 08af40744ae15a820d3e897567167a54e696a0fe /test | |
parent | 23b51287aa31630c5454fecb5991fd18f7528366 (diff) | |
download | tracifyjs-b1e05fd48afd9aceaa00cc621a8f6ac22c097398.tar.gz tracifyjs-b1e05fd48afd9aceaa00cc621a8f6ac22c097398.zip |
fix corner case in `inline` & `sequences` (#4718)
fixes #4717
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/awaits.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/compress/awaits.js b/test/compress/awaits.js index 77735991..974134c6 100644 --- a/test/compress/awaits.js +++ b/test/compress/awaits.js @@ -1246,3 +1246,37 @@ issue_4618: { expect_stdout: "function" node_version: ">=8" } + +issue_4717: { + options = { + inline: true, + reduce_vars: true, + sequences: true, + side_effects: true, + unused: true, + } + input: { + (function() { + async function f() { + var a = function() { + await; + }(); + return "FAIL"; + } + return f(); + })().then(console.log).catch(function() { + console.log("PASS"); + }); + } + expect: { + (async function() { + return function() { + await; + }(), "FAIL"; + })().then(console.log).catch(function() { + console.log("PASS"); + }); + } + expect_stdout: "PASS" + node_version: ">=8" +} |