diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-11-24 07:26:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-24 07:26:22 +0800 |
commit | eb001dc1d9efbb81841410c06d854091473061ee (patch) | |
tree | 023b1b9608276d6bb34aa6b5cf4285b91f7b7bba /test/compress/collapse_vars.js | |
parent | aa9bdf416e5b288bbae8417780abf2f235bacfd4 (diff) | |
download | tracifyjs-eb001dc1d9efbb81841410c06d854091473061ee.tar.gz tracifyjs-eb001dc1d9efbb81841410c06d854091473061ee.zip |
fix argument/atom collision by `collapse_vars` (#2507)
fixes #2506
Diffstat (limited to 'test/compress/collapse_vars.js')
-rw-r--r-- | test/compress/collapse_vars.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js index e89d44df..844d5b0f 100644 --- a/test/compress/collapse_vars.js +++ b/test/compress/collapse_vars.js @@ -3618,3 +3618,41 @@ issue_2497: { } } } + +issue_2506: { + options = { + collapse_vars: true, + reduce_vars: true, + unused: true, + } + input: { + var c = 0; + function f0(bar) { + function f1(Infinity_2) { + function f13(NaN) { + if (false <= NaN & this >> 1 >= 0) { + c++; + } + } + var b_2 = f13(NaN, c++); + } + var bar = f1(-3, -1); + } + f0(false); + console.log(c); + } + expect: { + var c = 0; + function f0(bar) { + (function(Infinity_2) { + (function(NaN) { + if (false <= 0/0 & this >> 1 >= 0) + c++; + })(0, c++); + })(); + } + f0(false); + console.log(c); + } + expect_stdout: "1" +} |