diff options
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/collapse_vars.js | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js index 24f8ffa3..7f3c470b 100644 --- a/test/compress/collapse_vars.js +++ b/test/compress/collapse_vars.js @@ -2256,3 +2256,67 @@ issue_2187_3: { } expect_stdout: "1" } + +issue_2203_1: { + options = { + collapse_vars: true, + unused: true, + } + input: { + a = "FAIL"; + console.log({ + a: "PASS", + b: function() { + return function(c) { + return c.a; + }((String, (Object, this))); + } + }.b()); + } + expect: { + a = "FAIL"; + console.log({ + a: "PASS", + b: function() { + return function(c) { + return c.a; + }((String, (Object, this))); + } + }.b()); + } + expect_stdout: "PASS" +} + +issue_2203_2: { + options = { + collapse_vars: true, + unused: true, + } + input: { + a = "PASS"; + console.log({ + a: "FAIL", + b: function() { + return function(c) { + return c.a; + }((String, (Object, function() { + return this; + }()))); + } + }.b()); + } + expect: { + a = "PASS"; + console.log({ + a: "FAIL", + b: function() { + return function(c) { + return (String, (Object, function() { + return this; + }())).a; + }(); + } + }.b()); + } + expect_stdout: "PASS" +} |