diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/hoist_props.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/compress/hoist_props.js b/test/compress/hoist_props.js index 0e399167..46af9d72 100644 --- a/test/compress/hoist_props.js +++ b/test/compress/hoist_props.js @@ -824,3 +824,35 @@ issue_3071_2_toplevel: { } expect_stdout: "1" } + +issue_3071_3: { + options = { + hoist_props: true, + reduce_vars: true, + } + input: { + var c = 0; + (function(a, b) { + (function f(o) { + var n = 2; + while (--b + (o = { + p: c++, + }) && --n > 0); + })(); + })(); + console.log(c); + } + expect: { + var c = 0; + (function(a, b) { + (function f(o) { + var n = 2; + while (--b + (o = { + p: c++, + }) && --n > 0); + })(); + })(); + console.log(c); + } + expect_stdout: "2" +} |