diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2019-10-14 18:15:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-14 18:15:40 +0800 |
commit | 736019b767548268044e665bd6cde4b5e34c0bd3 (patch) | |
tree | c64e48fda578e3cbaddbcbf1d9c8929dede44961 /test | |
parent | a39bdb584097b376250e6d09cd9ee9453b9f43de (diff) | |
download | tracifyjs-736019b767548268044e665bd6cde4b5e34c0bd3.tar.gz tracifyjs-736019b767548268044e665bd6cde4b5e34c0bd3.zip |
fix corner cases in `ie8` (#3472)
fixes #3471
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/ie8.js | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/test/compress/ie8.js b/test/compress/ie8.js index f0298de3..94b83de6 100644 --- a/test/compress/ie8.js +++ b/test/compress/ie8.js @@ -1013,3 +1013,71 @@ issue_3468_ie8: { } expect_stdout: "function" } + +issue_3471: { + options = { + ie8: false, + functions: true, + reduce_vars: true, + toplevel: true, + unused: true, + } + input: { + var c = 1; + function f() { + var a = function g() { + --c && f(); + g.p = 0; + }; + for (var p in a) + a[p]; + } + f(); + } + expect: { + var c = 1; + (function f() { + function a() { + --c && f(); + a.p = 0; + } + for (var p in a) + a[p]; + })(); + } + expect_stdout: true +} + +issue_3471_ie8: { + options = { + ie8: true, + functions: true, + reduce_vars: true, + toplevel: true, + unused: true, + } + input: { + var c = 1; + function f() { + var a = function g() { + --c && f(); + g.p = 0; + }; + for (var p in a) + a[p]; + } + f(); + } + expect: { + var c = 1; + (function f() { + var a = function g() { + --c && f(); + g.p = 0; + }; + for (var p in a) + a[p]; + })(); + } + expect_stdout: true +} |