diff options
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/collapse_vars.js | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js index b5b97d24..e2c5f1be 100644 --- a/test/compress/collapse_vars.js +++ b/test/compress/collapse_vars.js @@ -2949,3 +2949,69 @@ conditional_2: { } expect_stdout: "5 5" } + +issue_2425_1: { + options = { + collapse_vars: true, + unused: true, + } + input: { + var a = 8; + (function(b) { + b.toString(); + })(--a, a |= 10); + console.log(a); + } + expect: { + var a = 8; + (function(b) { + b.toString(); + })(--a, a |= 10); + console.log(a); + } + expect_stdout: "15" +} + +issue_2425_2: { + options = { + collapse_vars: true, + unused: true, + } + input: { + var a = 8; + (function(b, c) { + b.toString(); + })(--a, a |= 10); + console.log(a); + } + expect: { + var a = 8; + (function(b, c) { + b.toString(); + })(--a, a |= 10); + console.log(a); + } + expect_stdout: "15" +} + +issue_2425_3: { + options = { + collapse_vars: true, + unused: true, + } + input: { + var a = 8; + (function(b, b) { + b.toString(); + })(--a, a |= 10); + console.log(a); + } + expect: { + var a = 8; + (function(b, b) { + (a |= 10).toString(); + })(--a); + console.log(a); + } + expect_stdout: "15" +} |