diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-02-05 20:03:22 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-05 20:03:22 +0000 |
commit | c93ca6ee5386f824e60bea6563d249c13854f171 (patch) | |
tree | 81db56d3b951a00a9334fab457a776af371cd9e9 /test | |
parent | df506439b16c550f7e8da30b392f17b0ca4c2e4a (diff) | |
download | tracifyjs-c93ca6ee5386f824e60bea6563d249c13854f171.tar.gz tracifyjs-c93ca6ee5386f824e60bea6563d249c13854f171.zip |
fix corner case in `ie8` & `reduce_vars` (#3706)
fixes #3703
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/ie8.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/compress/ie8.js b/test/compress/ie8.js index f8ce35dc..7ec8037f 100644 --- a/test/compress/ie8.js +++ b/test/compress/ie8.js @@ -2361,3 +2361,40 @@ issue_3542: { } expect_stdout: "1" } + +issue_3703: { + options = { + ie8: true, + reduce_vars: true, + toplevel: true, + unused: true, + } + input: { + var a = "PASS"; + function f() { + var b; + function g() { + a = "FAIL"; + } + var c = g; + function h() { + f; + } + a ? b |= c : b.p; + } + f(); + console.log(a); + } + expect: { + var a = "PASS"; + (function() { + var b; + var c = function g() { + a = "FAIL"; + }; + a ? b |= c : b.p; + })(); + console.log(a); + } + expect_stdout: "PASS" +} |