aboutsummaryrefslogtreecommitdiff
path: root/test/compress/if_return.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress/if_return.js')
-rw-r--r--test/compress/if_return.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/compress/if_return.js b/test/compress/if_return.js
index 857406d4..82df1cea 100644
--- a/test/compress/if_return.js
+++ b/test/compress/if_return.js
@@ -544,3 +544,32 @@ if_body_return_3: {
"PASS",
]
}
+
+issue_3600: {
+ options = {
+ if_return: true,
+ inline: true,
+ side_effects: true,
+ unused: true,
+ }
+ input: {
+ var c = 0;
+ (function() {
+ if ([ ][c++]); else return;
+ return void function() {
+ var b = --b, a = c = 42;
+ return c;
+ }();
+ })();
+ console.log(c);
+ }
+ expect: {
+ var c = 0;
+ (function() {
+ if ([][c++]) b = --b, c = 42;
+ var b;
+ })();
+ console.log(c);
+ }
+ expect_stdout: "1"
+}