From 77e1bda4265c9a3fe36937dd734fab85db38437c Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Thu, 10 Dec 2020 16:48:41 +0000 Subject: improve fix for #4355 (#4357) --- test/compress/loops.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'test/compress') 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" +} -- cgit v1.2.3