diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-05-01 02:06:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-01 09:06:40 +0800 |
commit | 74801de315df085b0657660dcb9615cca67743e1 (patch) | |
tree | 9e45d47a8f12d69e09e3c07758eacdd3d197a519 /test | |
parent | f80d5b8c9ec0de7b3e7f99981da9f2d39ece66c4 (diff) | |
download | tracifyjs-74801de315df085b0657660dcb9615cca67743e1.tar.gz tracifyjs-74801de315df085b0657660dcb9615cca67743e1.zip |
fix corner cases in `inline` (#3834)
fixes #3833
fixes #3835
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/functions.js | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/test/compress/functions.js b/test/compress/functions.js index 262bb6ac..f5ad08b4 100644 --- a/test/compress/functions.js +++ b/test/compress/functions.js @@ -4590,3 +4590,50 @@ substitude_use_strict: { "PASS", ] } + +issue_3833: { + options = { + inline: true, + keep_fargs: "strict", + reduce_vars: true, + toplevel: true, + unused: true, + } + input: { + function f(a) { + return function() { + while (a); + console.log("PASS"); + }(); + } + f(); + } + expect: { + (function() { + while (a); + console.log("PASS"); + })(); + var a; + } + expect_stdout: "PASS" +} + +issue_3835: { + options = { + inline: true, + reduce_vars: true, + } + input: { + (function f() { + return function() { + return f(); + }(); + })(); + } + expect: { + (function f() { + return f(); + })(); + } + expect_stdout: true +} |