diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/functions.js | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/test/compress/functions.js b/test/compress/functions.js index 2d00c594..c43c17eb 100644 --- a/test/compress/functions.js +++ b/test/compress/functions.js @@ -2916,3 +2916,68 @@ issue_2485: { } expect_stdout: "6" } + +issue_3364: { + options = { + functions: true, + reduce_vars: true, + toplevel: true, + unused: true, + } + mangle = {} + input: { + var s = 2, a = 100, b = 10, c = 0; + function f(p, e, r) { + try { + for (var i = 1; i-- > 0;) + var a = function(x) { + function g(y) { + y && y[a++]; + } + var x = g(--s >= 0 && f(c++)); + for (var j = 1; --j > 0;); + }(); + } catch (e) { + try { + return; + } catch (z) { + for (var k = 1; --k > 0;) { + for (var l = 1; l > 0; --l) { + var n = function() {}; + for (var k in n) + var o = (n, k); + } + } + } + } + } + var r = f(); + console.log(c); + } + expect: { + var s = 2, c = 0; + (function n(r, o, a) { + try { + for (var f = 1; f-- >0;) + var t = function(r) { + (function(r) { + r && r[t++]; + })(--s >= 0 && n(c++)); + for (var o = 1; --o > 0;); + }(); + } catch (o) { + try { + return; + } catch (r) { + for (var v = 1; --v > 0;) + for (var i = 1; i > 0;--i) { + function u() {} + for (var v in u); + } + } + } + })(); + console.log(c); + } + expect_stdout: "2" +} |