From eb001dc1d9efbb81841410c06d854091473061ee Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Fri, 24 Nov 2017 07:26:22 +0800 Subject: fix argument/atom collision by `collapse_vars` (#2507) fixes #2506 --- test/compress/collapse_vars.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'test/compress/collapse_vars.js') 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" +} -- cgit v1.2.3