diff options
Diffstat (limited to 'test/compress/loops.js')
-rw-r--r-- | test/compress/loops.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/compress/loops.js b/test/compress/loops.js index cfabe6fd..69150820 100644 --- a/test/compress/loops.js +++ b/test/compress/loops.js @@ -1222,3 +1222,35 @@ do_continue: { } expect_stdout: "PASS" } + +issue_4240: { + options = { + loops: true, + reduce_funcs: true, + reduce_vars: true, + unused: true, + } + input: { + (function(a) { + function f() { + var o = { PASS: 42 }; + for (a in o); + } + (function() { + if (f()); + })(); + console.log(a); + })(); + } + expect: { + (function(a) { + (function() { + if (function() { + for (a in { PASS: 42 }); + }()); + })(); + console.log(a); + })(); + } + expect_stdout: "PASS" +} |