diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-03-03 19:30:07 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-04 03:30:07 +0800 |
commit | 20be5209c08f95802198c7a5d3acd0767fcd4e70 (patch) | |
tree | dc6093c4aed536d0c7278292daecdfa61f283459 /test/compress | |
parent | 2a49760032dea89032d6bc82dabab5e9e53bb310 (diff) | |
download | tracifyjs-20be5209c08f95802198c7a5d3acd0767fcd4e70.tar.gz tracifyjs-20be5209c08f95802198c7a5d3acd0767fcd4e70.zip |
fix corner cases in `ie8` & `side_effects` (#4731)
fixes #4729
fixes #4730
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/ie8.js | 25 | ||||
-rw-r--r-- | test/compress/side_effects.js | 30 |
2 files changed, 55 insertions, 0 deletions
diff --git a/test/compress/ie8.js b/test/compress/ie8.js index ed3950a0..7e49672f 100644 --- a/test/compress/ie8.js +++ b/test/compress/ie8.js @@ -2919,3 +2919,28 @@ issue_4568: { } expect_stdout: "undefined 1" } + +issue_4729: { + options = { + ie8: true, + toplevel: true, + unused: true, + } + input: { + try { + f; + } catch(e) { + var a = a && a[function f() {}]; + console.log("PASS"); + } + } + expect: { + try { + f; + } catch(e) { + (function f() {}); + console.log("PASS"); + } + } + expect_stdout: "PASS" +} diff --git a/test/compress/side_effects.js b/test/compress/side_effects.js index fd6cabc6..03298274 100644 --- a/test/compress/side_effects.js +++ b/test/compress/side_effects.js @@ -558,3 +558,33 @@ drop_side_effect_free_call: { } expect_stdout: "PASS" } + +issue_4730_1: { + options = { + side_effects: true, + } + input: { + var a; + console.log("PASS") + (a && a[a.p]); + } + expect: { + var a; + console.log("PASS"); + } + expect_stdout: "PASS" +} + +issue_4730_2: { + options = { + side_effects: true, + } + input: { + var a; + !console.log("PASS") || a && a[a.p]; + } + expect: { + var a; + console.log("PASS"); + } + expect_stdout: "PASS" +} |