aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-05-10 21:29:55 +0100
committerGitHub <noreply@github.com>2020-05-11 04:29:55 +0800
commitc76ee4b868f2b2cdf87e7ab4a000997c475bdbf3 (patch)
tree5523ed4b3e25c9bb46549cf617eefab4fff7a756 /test
parente23bf480522e64db43f8764fef64312750c58e77 (diff)
downloadtracifyjs-c76ee4b868f2b2cdf87e7ab4a000997c475bdbf3.tar.gz
tracifyjs-c76ee4b868f2b2cdf87e7ab4a000997c475bdbf3.zip
enhance `if_return` (#3875)
Diffstat (limited to 'test')
-rw-r--r--test/compress/if_return.js21
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"
+}