diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-05-10 21:29:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-11 04:29:55 +0800 |
commit | c76ee4b868f2b2cdf87e7ab4a000997c475bdbf3 (patch) | |
tree | 5523ed4b3e25c9bb46549cf617eefab4fff7a756 /test | |
parent | e23bf480522e64db43f8764fef64312750c58e77 (diff) | |
download | tracifyjs-c76ee4b868f2b2cdf87e7ab4a000997c475bdbf3.tar.gz tracifyjs-c76ee4b868f2b2cdf87e7ab4a000997c475bdbf3.zip |
enhance `if_return` (#3875)
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/if_return.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/compress/if_return.js b/test/compress/if_return.js index 82df1cea..836fab17 100644 --- a/test/compress/if_return.js +++ b/test/compress/if_return.js @@ -573,3 +573,24 @@ issue_3600: { } expect_stdout: "1" } + +iife_if_return_simple: { + options = { + conditionals: true, + if_return: true, + inline: true, + sequences: true, + side_effects: true, + } + input: { + (function() { + if (console) + return console.log("PASS"); + console.log("FAIL"); + })(); + } + expect: { + console ? console.log("PASS") : console.log("FAIL"); + } + expect_stdout: "PASS" +} |