aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-12-10 16:48:41 +0000
committerGitHub <noreply@github.com>2020-12-11 00:48:41 +0800
commit77e1bda4265c9a3fe36937dd734fab85db38437c (patch)
treee6d4c60975b88efd74bbc5415f82d4a1bfd5d074 /test/compress
parenta59593cac8b5acbefa07daf1fca3af6a72c9d262 (diff)
downloadtracifyjs-77e1bda4265c9a3fe36937dd734fab85db38437c.tar.gz
tracifyjs-77e1bda4265c9a3fe36937dd734fab85db38437c.zip
improve fix for #4355 (#4357)
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/loops.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/compress/loops.js b/test/compress/loops.js
index c16fa5bd..acbc8269 100644
--- a/test/compress/loops.js
+++ b/test/compress/loops.js
@@ -1255,3 +1255,28 @@ issue_4240: {
}
expect_stdout: "PASS"
}
+
+issue_4355: {
+ options = {
+ dead_code: true,
+ evaluate: true,
+ loops: true,
+ side_effects: true,
+ unused: true,
+ }
+ input: {
+ while (function() {
+ var a;
+ for (a in console.log("PASS"))
+ var b = 0;
+ }())
+ var c;
+ }
+ expect: {
+ (function() {
+ console.log("PASS");
+ })();
+ var c;
+ }
+ expect_stdout: "PASS"
+}