diff options
Diffstat (limited to 'test/compress/collapse_vars.js')
-rw-r--r-- | test/compress/collapse_vars.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js index 449ce3d5..3ac8894a 100644 --- a/test/compress/collapse_vars.js +++ b/test/compress/collapse_vars.js @@ -9057,3 +9057,31 @@ issue_4874: { } expect_stdout: "PASS" } + +issue_4891: { + options = { + collapse_vars: true, + reduce_vars: true, + toplevel: true, + } + input: { + var a = 0, b; + a++; + console.log(b = a, b); + b--; + a.a += 0; + console.log(b); + } + expect: { + var a = 0, b; + a++; + console.log(a, b = a); + b--; + a.a += 0; + console.log(b); + } + expect_stdout: [ + "1 1", + "0", + ] +} |