diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-05-07 13:53:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-07 20:53:05 +0800 |
commit | 88985a46ed771f312f799853740ec2ba4f87ea03 (patch) | |
tree | d30b9c78a267aaf7ffeb26a8b1f210e3b2f054c5 /test | |
parent | 34ead0430bf24323495f47751e726dcc6bd8d5e7 (diff) | |
download | tracifyjs-88985a46ed771f312f799853740ec2ba4f87ea03.tar.gz tracifyjs-88985a46ed771f312f799853740ec2ba4f87ea03.zip |
fix corner case in `inline` (#3853)
fixes #3852
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/drop-unused.js | 2 | ||||
-rw-r--r-- | test/compress/functions.js | 21 | ||||
-rw-r--r-- | test/compress/ie8.js | 2 |
3 files changed, 23 insertions, 2 deletions
diff --git a/test/compress/drop-unused.js b/test/compress/drop-unused.js index d7d92bb2..ff230ae2 100644 --- a/test/compress/drop-unused.js +++ b/test/compress/drop-unused.js @@ -2366,7 +2366,7 @@ function_parameter_ie8: { } expect: { (function() { - (function f() { + (function() { console.log("PASS"); })(); })(); diff --git a/test/compress/functions.js b/test/compress/functions.js index 439c073a..ae113c84 100644 --- a/test/compress/functions.js +++ b/test/compress/functions.js @@ -4660,3 +4660,24 @@ issue_3836: { } expect_stdout: "PASS" } + +issue_3852: { + options = { + collapse_vars: true, + inline: true, + unused: true, + } + input: { + console.log(function(a) { + return function(b) { + return b && (b[0] = 0), "PASS"; + }(a); + }(42)); + } + expect: { + console.log(function(a) { + return a && (a[0] = 0), "PASS"; + }(42)); + } + expect_stdout: "PASS" +} diff --git a/test/compress/ie8.js b/test/compress/ie8.js index 0c79ece0..53f78f1b 100644 --- a/test/compress/ie8.js +++ b/test/compress/ie8.js @@ -2389,7 +2389,7 @@ issue_3703: { var a = "PASS"; (function() { var b; - var c = function g() { + var c = function() { a = "FAIL"; }; a ? b |= c : b.p; |