diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/ie8.js | 26 | ||||
-rw-r--r-- | test/compress/rename.js | 77 |
2 files changed, 90 insertions, 13 deletions
diff --git a/test/compress/ie8.js b/test/compress/ie8.js index c5a20ed7..dd9bae47 100644 --- a/test/compress/ie8.js +++ b/test/compress/ie8.js @@ -458,8 +458,8 @@ issue_2976_2: { } expect: { console.log(function f() { - var o; - return o === f ? "FAIL" : "PASS"; + var n; + return n === f ? "FAIL" : "PASS"; }()); } expect_stdout: "PASS" @@ -477,9 +477,9 @@ issue_2976_3: { }()); } expect: { - console.log(function r() { - var o; - return o === r ? "FAIL" : "PASS"; + console.log(function o() { + var n; + return n === o ? "FAIL" : "PASS"; }()); } expect_stdout: "PASS" @@ -772,17 +772,17 @@ issue_3215_2: { } expect: { console.log(function foo() { - var r = function r(o) { + var o = function o(n) { return "PASS"; }; try { "moo"; - } catch (o) { - r = function r(o) { + } catch (n) { + o = function o(n) { return "FAIL"; }; } - return r; + return o; }()()); } expect_stdout: "PASS" @@ -846,17 +846,17 @@ issue_3215_4: { } expect: { console.log(function foo() { - var r = function r(o) { + var o = function o(n) { return "FAIL"; }; try { moo; - } catch (o) { - r = function r(o) { + } catch (n) { + o = function o(n) { return "PASS"; }; } - return r; + return o; }()()); } expect_stdout: "PASS" diff --git a/test/compress/rename.js b/test/compress/rename.js index 83187dff..eab989b1 100644 --- a/test/compress/rename.js +++ b/test/compress/rename.js @@ -534,3 +534,80 @@ function_catch_catch_ie8: { "undefined", ] } + +function_do_catch_ie8: { + rename = true + options = { + ie8: true, + side_effects: true, + unused: true, + } + mangle = { + ie8: true, + toplevel: true, + } + input: { + var a = 1, b = 1, c = 0; + function d(e) { + var f, g, h, i; + do { + try { + try { + var j = function q(){}(); + } catch (r) { + --a && w("ddddddddeeeeeeegggggggggiiiiilllllllnnnnntuuuuuuuuyyyyyyy"); + var k, l, m, n, o; + --m; + --n; + --o; + } + try { + i[1]; + } catch (s) { + var p; + switch (function t() { + c++; + }()) { + case j + --p: + } + } + } catch (u) {} + } while (--i); + b--; + } + d(); + console.log(b, c); + } + expect: { + var t = 1, u = 1, y = 0; + function c(c) { + var d; + do { + try { + try { + var e = void 0; + } catch (i) { + --t && w("ddddddddeeeeeeegggggggggiiiiilllllllnnnnntuuuuuuuuyyyyyyy"); + 0; + 0; + 0; + } + try { + d[1]; + } catch (l) { + var g; + switch(function x() { + y++; + }()) { + case e + --g: + } + } + } catch (n) {} + } while (--d); + u--; + } + c(); + console.log(u, y); + } + expect_stdout: "0 1" +} |