From fe5a68f9d5a93557d44c48cd0a8ee533e2bd1a47 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Sun, 5 Nov 2017 00:00:18 +0800 Subject: maintain call argument order in `collapse_vars` (#2426) fixes #2425 --- test/compress/collapse_vars.js | 66 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) (limited to 'test/compress/collapse_vars.js') 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" +} -- cgit v1.2.3 '>range
path: root/hydra.gnu.org.pub
AgeCommit message (Expand)Author