diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-04-11 12:54:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-11 19:54:26 +0800 |
commit | 903a5df9a5bfcaac6cc6da8294f3de8599004a23 (patch) | |
tree | 50673da6b93383e7fa56f5889a6fe5394ef77145 /test | |
parent | c810ecd0810c86dc9cd25b443c33aa998649e390 (diff) | |
download | tracifyjs-903a5df9a5bfcaac6cc6da8294f3de8599004a23.tar.gz tracifyjs-903a5df9a5bfcaac6cc6da8294f3de8599004a23.zip |
fix corner case in `inline` (#3778)
fixes #3777
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/functions.js | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/test/compress/functions.js b/test/compress/functions.js index c1522e2e..4dc685be 100644 --- a/test/compress/functions.js +++ b/test/compress/functions.js @@ -4014,3 +4014,51 @@ issue_3772: { } expect_stdout: "PASS" } + +issue_3777_1: { + options = { + inline: true, + reduce_vars: true, + side_effects: true, + } + input: { + (function() { + ff && ff(NaN); + function ff(a) { + var a = console.log("PASS"); + } + })(); + } + expect: { + (function() { + ff && ff(NaN); + function ff(a) { + var a = console.log("PASS"); + } + })(); + } + expect_stdout: "PASS" +} + +issue_3777_2: { + options = { + inline: true, + pure_getters: "strict", + reduce_vars: true, + side_effects: true, + toplevel: true, + } + input: { + ff(ff.p); + function ff(a) { + var a = console.log("PASS"); + } + } + expect: { + ff(ff.p); + function ff(a) { + var a = console.log("PASS"); + } + } + expect_stdout: "PASS" +} |