From 9c49a02b67bb2cab8bf51c44e1d7d06a8510f6f4 Mon Sep 17 00:00:00 2001 From: Tooru Fujisawa Date: Tue, 5 Dec 2017 09:42:40 +0900 Subject: [PATCH] Bug 1228841 - Part 2: Remove testcases specific to conditional catch in js/. r=evilpie --- js/src/jit-test/tests/baseline/bug843811-1.js | 11 -- js/src/jit-test/tests/baseline/bug843811-2.js | 10 -- js/src/jit-test/tests/baseline/bug843811-3.js | 11 -- js/src/jit-test/tests/basic/bug640078.js | 4 - js/src/jit-test/tests/basic/bug787309.js | 7 -- js/src/jit-test/tests/basic/bug787848.js | 8 -- js/src/jit-test/tests/ion/bug799185-1.js | 14 --- js/src/jit-test/tests/jaeger/bug553781-2.js | 13 -- js/src/jit-test/tests/jaeger/bug553781.js | 11 -- .../ecma_5/extensions/iterator-in-catch.js | 20 ---- .../js1_5/extensions/catchguard-001-n.js | 38 ------ .../tests/js1_5/extensions/catchguard-001.js | 44 ------- .../tests/js1_5/extensions/catchguard-002.js | 39 ------ .../tests/js1_5/extensions/catchguard-003.js | 54 --------- .../js1_5/extensions/regress-346494-01.js | 86 ------------- .../tests/js1_5/extensions/regress-346494.js | 79 ------------ .../js1_5/extensions/regress-350312-02.js | 109 ----------------- .../js1_5/extensions/regress-350312-03.js | 113 ------------------ .../js1_5/extensions/regress-351102-01.js | 36 ------ .../js1_5/extensions/regress-351102-02.js | 43 ------- .../js1_5/extensions/regress-351102-06.js | 31 ----- .../tests/js1_5/extensions/regress-374589.js | 31 ----- .../js1_7/extensions/regress-351102-03.js | 41 ------- .../js1_7/extensions/regress-351102-04.js | 32 ----- .../js1_7/extensions/regress-351102-05.js | 31 ----- .../js1_7/extensions/regress-351102-07.js | 40 ------- js/src/tests/js1_7/regress/regress-375695.js | 24 ---- .../js1_8_5/extensions/regress-677589.js | 10 -- 28 files changed, 990 deletions(-) delete mode 100644 js/src/jit-test/tests/baseline/bug843811-1.js delete mode 100644 js/src/jit-test/tests/baseline/bug843811-2.js delete mode 100644 js/src/jit-test/tests/baseline/bug843811-3.js delete mode 100644 js/src/jit-test/tests/basic/bug640078.js delete mode 100644 js/src/jit-test/tests/basic/bug787309.js delete mode 100644 js/src/jit-test/tests/basic/bug787848.js delete mode 100644 js/src/jit-test/tests/ion/bug799185-1.js delete mode 100644 js/src/jit-test/tests/jaeger/bug553781-2.js delete mode 100644 js/src/jit-test/tests/jaeger/bug553781.js delete mode 100644 js/src/tests/ecma_5/extensions/iterator-in-catch.js delete mode 100644 js/src/tests/js1_5/extensions/catchguard-001-n.js delete mode 100644 js/src/tests/js1_5/extensions/catchguard-001.js delete mode 100644 js/src/tests/js1_5/extensions/catchguard-002.js delete mode 100644 js/src/tests/js1_5/extensions/catchguard-003.js delete mode 100644 js/src/tests/js1_5/extensions/regress-346494-01.js delete mode 100644 js/src/tests/js1_5/extensions/regress-346494.js delete mode 100644 js/src/tests/js1_5/extensions/regress-350312-02.js delete mode 100644 js/src/tests/js1_5/extensions/regress-350312-03.js delete mode 100644 js/src/tests/js1_5/extensions/regress-351102-01.js delete mode 100644 js/src/tests/js1_5/extensions/regress-351102-02.js delete mode 100644 js/src/tests/js1_5/extensions/regress-351102-06.js delete mode 100644 js/src/tests/js1_5/extensions/regress-374589.js delete mode 100644 js/src/tests/js1_7/extensions/regress-351102-03.js delete mode 100644 js/src/tests/js1_7/extensions/regress-351102-04.js delete mode 100644 js/src/tests/js1_7/extensions/regress-351102-05.js delete mode 100644 js/src/tests/js1_7/extensions/regress-351102-07.js delete mode 100644 js/src/tests/js1_7/regress/regress-375695.js delete mode 100644 js/src/tests/js1_8_5/extensions/regress-677589.js diff --git a/js/src/jit-test/tests/baseline/bug843811-1.js b/js/src/jit-test/tests/baseline/bug843811-1.js deleted file mode 100644 index 2fe9289e5060..000000000000 --- a/js/src/jit-test/tests/baseline/bug843811-1.js +++ /dev/null @@ -1,11 +0,0 @@ -// |jit-test| error: uncaught exception: -evalcx("\ - try {\ - throw\"\"\ - } catch (\ - x if (function(){\ - x\ - })()\ - ) {}\ -", newGlobal("")) - diff --git a/js/src/jit-test/tests/baseline/bug843811-2.js b/js/src/jit-test/tests/baseline/bug843811-2.js deleted file mode 100644 index 390e19a3eae7..000000000000 --- a/js/src/jit-test/tests/baseline/bug843811-2.js +++ /dev/null @@ -1,10 +0,0 @@ -// |jit-test| error: uncaught exception: -eval("\ - try {\ - throw\"\"\ - } catch (\ - x if (function(){\ - x\ - })()\ - ) {}\ -") diff --git a/js/src/jit-test/tests/baseline/bug843811-3.js b/js/src/jit-test/tests/baseline/bug843811-3.js deleted file mode 100644 index 697613e5aad7..000000000000 --- a/js/src/jit-test/tests/baseline/bug843811-3.js +++ /dev/null @@ -1,11 +0,0 @@ -// |jit-test| error: uncaught exception: -Function("\ - try {\ - throw\"\"\ - } catch (\ - x if (function(){\ - x\ - })()\ - ) {}\ -")() - diff --git a/js/src/jit-test/tests/basic/bug640078.js b/js/src/jit-test/tests/basic/bug640078.js deleted file mode 100644 index 27e5470815b9..000000000000 --- a/js/src/jit-test/tests/basic/bug640078.js +++ /dev/null @@ -1,4 +0,0 @@ -eval("\ - try{}\ - catch(w if(function(){})){4067286856}\ -") diff --git a/js/src/jit-test/tests/basic/bug787309.js b/js/src/jit-test/tests/basic/bug787309.js deleted file mode 100644 index 51129c88dfd1..000000000000 --- a/js/src/jit-test/tests/basic/bug787309.js +++ /dev/null @@ -1,7 +0,0 @@ -// |jit-test| error: TypeError -try { - h -} catch (x -if gc()) {} finally { - this.z.z -} diff --git a/js/src/jit-test/tests/basic/bug787848.js b/js/src/jit-test/tests/basic/bug787848.js deleted file mode 100644 index 2972a4c8c167..000000000000 --- a/js/src/jit-test/tests/basic/bug787848.js +++ /dev/null @@ -1,8 +0,0 @@ -// |jit-test| error: TypeError -try { - i -} -catch (x if (function() {})()) {} -catch (d) { - this.z.z -} diff --git a/js/src/jit-test/tests/ion/bug799185-1.js b/js/src/jit-test/tests/ion/bug799185-1.js deleted file mode 100644 index 3584bed2f463..000000000000 --- a/js/src/jit-test/tests/ion/bug799185-1.js +++ /dev/null @@ -1,14 +0,0 @@ -options('strict') -f = (function() { - for (var z = 0; z < 9; ++z) { - x = z - } - try { - i - } catch (x if null) { - let e - } catch (l) { - x.m - } -}) -for (a in f()) {} diff --git a/js/src/jit-test/tests/jaeger/bug553781-2.js b/js/src/jit-test/tests/jaeger/bug553781-2.js deleted file mode 100644 index b10c5c8919c1..000000000000 --- a/js/src/jit-test/tests/jaeger/bug553781-2.js +++ /dev/null @@ -1,13 +0,0 @@ -(function() { - do { - try { - return - } - catch(x if (c)) { - return - } (x) - } while (x) -})() - -/* Don't assert. */ - diff --git a/js/src/jit-test/tests/jaeger/bug553781.js b/js/src/jit-test/tests/jaeger/bug553781.js deleted file mode 100644 index 4c9b674321f8..000000000000 --- a/js/src/jit-test/tests/jaeger/bug553781.js +++ /dev/null @@ -1,11 +0,0 @@ -(function () { - try { - return - } catch (x if i) { - return - } - for (z in []); -})() - -/* Don't assert */ - diff --git a/js/src/tests/ecma_5/extensions/iterator-in-catch.js b/js/src/tests/ecma_5/extensions/iterator-in-catch.js deleted file mode 100644 index 390b585e936a..000000000000 --- a/js/src/tests/ecma_5/extensions/iterator-in-catch.js +++ /dev/null @@ -1,20 +0,0 @@ -//Bug 350712 - -function iterator () { - for (var i in []); -} - -try { - try { - throw 5; - } - catch(error if iterator()) { - assertEq(false, true); - } -} -catch(error) { - assertEq(error, 5); -} - -if (typeof reportCompare === "function") - reportCompare(true, true); diff --git a/js/src/tests/js1_5/extensions/catchguard-001-n.js b/js/src/tests/js1_5/extensions/catchguard-001-n.js deleted file mode 100644 index 3f8a403e8574..000000000000 --- a/js/src/tests/js1_5/extensions/catchguard-001-n.js +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- tab-width: 8; indent-tabs-mode: nil; js-indent-level: 4 -*- - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - - -DESCRIPTION = " the non-guarded catch should HAVE to appear last"; - -test(); - -function test() -{ - var EXCEPTION_DATA = "String exception"; - var e; - - printStatus ("Catchguard syntax negative test."); - - try - { - throw EXCEPTION_DATA; - } - catch (e) /* the non-guarded catch should HAVE to appear last */ - { - - } - catch (e if true) - { - - } - catch (e if false) - { - - } - - reportCompare('PASS', 'FAIL', - "Illegally constructed catchguard should have thrown " + - "an exception."); -} diff --git a/js/src/tests/js1_5/extensions/catchguard-001.js b/js/src/tests/js1_5/extensions/catchguard-001.js deleted file mode 100644 index 80d81d0a6024..000000000000 --- a/js/src/tests/js1_5/extensions/catchguard-001.js +++ /dev/null @@ -1,44 +0,0 @@ -/* -*- tab-width: 8; indent-tabs-mode: nil; js-indent-level: 4 -*- - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - - -test(); - -function test() -{ - var EXCEPTION_DATA = "String exception"; - var e = "foo"; - var caught = false; - - printStatus ("Basic catchguard test."); - - try - { - throw EXCEPTION_DATA; - } - catch (e if true) - { - caught = true; - e = "this change should not propagate outside of this scope"; - } - catch (e if false) - { - reportCompare('PASS', 'FAIL', "Catch block (e if false) should not have executed."); - } - catch (e) - { - reportCompare('PASS', 'FAIL', "Catch block (e) should not have executed."); - } - - if (!caught) - reportCompare('PASS', 'FAIL', "Exception was never caught."); - - if (e != "foo") - reportCompare('PASS', 'FAIL', "Exception data modified inside catch() scope should " + - "not be visible in the function scope (e = '" + - e + "'.)"); - - reportCompare('PASS', 'PASS', ''); -} diff --git a/js/src/tests/js1_5/extensions/catchguard-002.js b/js/src/tests/js1_5/extensions/catchguard-002.js deleted file mode 100644 index 308c16006a71..000000000000 --- a/js/src/tests/js1_5/extensions/catchguard-002.js +++ /dev/null @@ -1,39 +0,0 @@ -/* -*- tab-width: 8; indent-tabs-mode: nil; js-indent-level: 4 -*- - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - - -test(); - -function test() -{ - var EXCEPTION_DATA = "String exception"; - var e; - var caught = false; - - printStatus ("Basic catchguard test."); - - try - { - throw EXCEPTION_DATA; - } - catch (e if true) - { - caught = true; - } - catch (e if true) - { - reportCompare('PASS', 'FAIL', - "Second (e if true) catch block should not have executed."); - } - catch (e) - { - reportCompare('PASS', 'FAIL', "Catch block (e) should not have executed."); - } - - if (!caught) - reportCompare('PASS', 'FAIL', "Exception was never caught."); - - reportCompare('PASS', 'PASS', 'Basic catchguard test'); -} diff --git a/js/src/tests/js1_5/extensions/catchguard-003.js b/js/src/tests/js1_5/extensions/catchguard-003.js deleted file mode 100644 index de7689985e53..000000000000 --- a/js/src/tests/js1_5/extensions/catchguard-003.js +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- tab-width: 8; indent-tabs-mode: nil; js-indent-level: 4 -*- - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - - -test(); - -function test() -{ - var EXCEPTION_DATA = "String exception"; - var e = "foo", x = "foo"; - var caught = false; - - printStatus ("Catchguard 'Common Scope' test."); - - try - { - throw EXCEPTION_DATA; - } - catch (e if ((x = 1) && false)) - { - reportCompare('PASS', 'FAIL', - "Catch block (e if ((x = 1) && false) should not " + - "have executed."); - } - catch (e if (x == 1)) - { - caught = true; - } - catch (e) - { - reportCompare('PASS', 'FAIL', - "Same scope should be used across all catchguards."); - } - - if (!caught) - reportCompare('PASS', 'FAIL', - "Exception was never caught."); - - if (e != "foo") - reportCompare('PASS', 'FAIL', - "Exception data modified inside catch() scope should " + - "not be visible in the function scope (e ='" + - e + "'.)"); - - if (x != 1) - reportCompare('PASS', 'FAIL', - "Data modified in 'catchguard expression' should " + - "be visible in the function scope (x = '" + - x + "'.)"); - - reportCompare('PASS', 'PASS', 'Catchguard Common Scope test'); -} diff --git a/js/src/tests/js1_5/extensions/regress-346494-01.js b/js/src/tests/js1_5/extensions/regress-346494-01.js deleted file mode 100644 index 92168a1b4e94..000000000000 --- a/js/src/tests/js1_5/extensions/regress-346494-01.js +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 346494; -var summary = 'various try...catch tests'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - printBugNumber(BUGNUMBER); - printStatus (summary); - - var pfx = "(function (x) {try {throw x}", - cg1 = " catch (e if e === 42) {var v = 'catch guard 1 ' + e; actual += v + ','; print(v);}" - cg2 = " catch (e if e === 43) {var v = 'catch guard 2 ' + e; actual += v + ','; print(v);}" - cat = " catch (e) {var v = 'catch all ' + e; actual += v + ','; print(v);}" - fin = " finally{var v = 'fin'; actual += v + ','; print(v)}", - end = "})"; - - var exphash = { - pfx: "(function (y) { var result = ''; y = y + ',';", - cg1: "result += (y === '42,') ? ('catch guard 1 ' + y):'';", - cg2: "result += (y === '43,') ? ('catch guard 2 ' + y):'';", - cat: "result += /catch guard/.test(result) ? '': ('catch all ' + y);", - fin: "result += 'fin,';", - end: "return result;})" - }; - - var src = [ - pfx + fin + end, - pfx + cat + end, - pfx + cat + fin + end, - pfx + cg1 + end, - pfx + cg1 + fin + end, - pfx + cg1 + cat + end, - pfx + cg1 + cat + fin + end, - pfx + cg1 + cg2 + end, - pfx + cg1 + cg2 + fin + end, - pfx + cg1 + cg2 + cat + end, - pfx + cg1 + cg2 + cat + fin + end, - ]; - - var expsrc = [ - exphash.pfx + exphash.fin + exphash.end, - exphash.pfx + exphash.cat + exphash.end, - exphash.pfx + exphash.cat + exphash.fin + exphash.end, - exphash.pfx + exphash.cg1 + exphash.end, - exphash.pfx + exphash.cg1 + exphash.fin + exphash.end, - exphash.pfx + exphash.cg1 + exphash.cat + exphash.end, - exphash.pfx + exphash.cg1 + exphash.cat + exphash.fin + exphash.end, - exphash.pfx + exphash.cg1 + exphash.cg2 + exphash.end, - exphash.pfx + exphash.cg1 + exphash.cg2 + exphash.fin + exphash.end, - exphash.pfx + exphash.cg1 + exphash.cg2 + exphash.cat + exphash.end, - exphash.pfx + exphash.cg1 + exphash.cg2 + exphash.cat + exphash.fin + exphash.end, - ]; - - for (var i in src) { - print("\n=== " + src[i]); - var f = eval(src[i]); - print(src[i]); - var exp = eval(expsrc[i]); - // dis(f); - print('decompiling: ' + f); - - actual = ''; - try { expect = exp(42); f(42) } catch (e) { print('tried f(42), caught ' + e) } - reportCompare(expect, actual, summary); - - actual = ''; - try { expect = exp(43); f(43) } catch (e) { print('tried f(43), caught ' + e) } - reportCompare(expect, actual, summary); - - actual = ''; - try { expect = exp(44); f(44) } catch (e) { print('tried f(44), caught ' + e) } - reportCompare(expect, actual, summary); - } -} diff --git a/js/src/tests/js1_5/extensions/regress-346494.js b/js/src/tests/js1_5/extensions/regress-346494.js deleted file mode 100644 index 3a8c66898c62..000000000000 --- a/js/src/tests/js1_5/extensions/regress-346494.js +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 346494; -var summary = 'try-catch-finally scope'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - printBugNumber(BUGNUMBER); - printStatus (summary); - - function g() - { - try - { - throw "foo"; - } - catch(e if e == "bar") - { - } - catch(e if e == "baz") - { - } - finally - { - } - } - - expect = "foo"; - try - { - g(); - actual = 'No Exception'; - } - catch(ex) - { - actual = ex + ''; - } - reportCompare(expect, actual, summary); - - function h() - { - try - { - throw "foo"; - } - catch(e if e == "bar") - { - } - catch(e) - { - } - finally - { - } - } - - expect = "No Exception"; - try - { - h(); - actual = 'No Exception'; - } - catch(ex) - { - actual = ex + ''; - } - reportCompare(expect, actual, summary); -} diff --git a/js/src/tests/js1_5/extensions/regress-350312-02.js b/js/src/tests/js1_5/extensions/regress-350312-02.js deleted file mode 100644 index e80deb9ac67a..000000000000 --- a/js/src/tests/js1_5/extensions/regress-350312-02.js +++ /dev/null @@ -1,109 +0,0 @@ -/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 350312; -var summary = 'Accessing wrong stack slot with nested catch/finally'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - printBugNumber(BUGNUMBER); - printStatus (summary); - - function createPrint(obj) - { - return new Function("actual += " + obj + " + ','; " + - "print(" + obj + ");"); - } - - function createThrow(obj) - { - return new Function("throw " + obj + "; "); - } - - - function f(a, b, c) - { - try { - a(); - } catch (e if e == null) { - b(); - } finally { - c(); - } - } - - print('test 1'); - expect = 'a,c,'; - actual = ''; - try - { - f(createPrint("'a'"), createPrint("'b'"), createPrint("'c'")); - } - catch(ex) - { - actual += 'caught ' + ex; - } - reportCompare(expect, actual, summary + ': 1'); - - print('test 2'); - expect = 'c,caught a'; - actual = ''; - try - { - f(createThrow("'a'"), createPrint("'b'"), createPrint("'c'")); - } - catch(ex) - { - actual += 'caught ' + ex; - } - reportCompare(expect, actual, summary + ': 2'); - - print('test 3'); - expect = 'b,c,'; - actual = ''; - try - { - f(createThrow("null"), createPrint("'b'"), createPrint("'c'")); - } - catch(ex) - { - actual += 'caught ' + ex; - } - reportCompare(expect, actual, summary + ': 3'); - - print('test 4'); - expect = 'a,c,'; - actual = ''; - try - { - f(createPrint("'a'"), createThrow("'b'"), createPrint("'c'")); - } - catch(ex) - { - actual += 'caught ' + ex; - } - reportCompare(expect, actual, summary + ': 4'); - - print('test 5'); - expect = 'c,caught b'; - actual = ''; - try - { - f(createThrow("null"), createThrow("'b'"), createPrint("'c'")); - } - catch(ex) - { - actual += 'caught ' + ex; - } - reportCompare(expect, actual, summary + ': 5'); -} diff --git a/js/src/tests/js1_5/extensions/regress-350312-03.js b/js/src/tests/js1_5/extensions/regress-350312-03.js deleted file mode 100644 index ed9661071303..000000000000 --- a/js/src/tests/js1_5/extensions/regress-350312-03.js +++ /dev/null @@ -1,113 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 350312; -var summary = 'Accessing wrong stack slot with nested catch/finally'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - printBugNumber(BUGNUMBER); - printStatus (summary); - - var pfx = "(function (x) {try {if (x > 41) throw x}", - cg1a = " catch (e if e === 42) {var v = 'catch guard 1 ' + e; actual += v + ',';print(v);}" - cg1b = " catch (e if e === 42) {var v = 'catch guard 1 + throw ' + e; actual += v + ',';print(v); throw e;}" - cg2 = " catch (e if e === 43) {var v = 'catch guard 2 ' + e; actual += v + ',';print(v)}" - cat = " catch (e) {var v = 'catch all ' + e; print(v); if (e == 44) throw e}" - fin = " finally{var v = 'fin'; actual += v + ',';print(v)}", - end = "})"; - - var exphash = { - pfx: "(function (y) { var result = ''; y = y + ',';", - cg1a: " result += (y === '42,') ? ('catch guard 1 ' + y):'';", - cg1b: " result += (y === '42,') ? ('catch guard 1 + throw ' + y):'';", - cg2: " result += (y === '43,') ? ('catch guard 2 ' + y):'';", - cat: " result += (y > 41) ? ('catch all ' + y):'';", - fin: " result += 'fin,';", - end: "return result;})" - }; - - var src = [ - pfx + fin + end, - pfx + cat + end, - pfx + cat + fin + end, - pfx + cg1a + end, - pfx + cg1a + fin + end, - pfx + cg1a + cat + end, - pfx + cg1a + cat + fin + end, - pfx + cg1a + cg2 + end, - pfx + cg1a + cg2 + fin + end, - pfx + cg1a + cg2 + cat + end, - pfx + cg1a + cg2 + cat + fin + end, - pfx + cg1b + end, - pfx + cg1b + fin + end, - pfx + cg1b + cat + end, - pfx + cg1b + cat + fin + end, - pfx + cg1b + cg2 + end, - pfx + cg1b + cg2 + fin + end, - pfx + cg1b + cg2 + cat + end, - pfx + cg1b + cg2 + cat + fin + end, - ]; - - var expsrc = [ - exphash.pfx + exphash.fin + exphash.end, - exphash.pfx + exphash.cat + exphash.end, - exphash.pfx + exphash.cat + exphash.fin + exphash.end, - exphash.pfx + exphash.cg1a + exphash.end, - exphash.pfx + exphash.cg1a + exphash.fin + exphash.end, - exphash.pfx + exphash.cg1a + exphash.cat + exphash.end, - exphash.pfx + exphash.cg1a + exphash.cat + exphash.fin + exphash.end, - exphash.pfx + exphash.cg1a + exphash.cg2 + exphash.end, - exphash.pfx + exphash.cg1a + exphash.cg2 + exphash.fin + exphash.end, - exphash.pfx + exphash.cg1a + exphash.cg2 + exphash.cat + exphash.end, - exphash.pfx + exphash.cg1a + exphash.cg2 + exphash.cat + exphash.fin + exphash.end, - exphash.pfx + exphash.cg1b + exphash.end, - exphash.pfx + exphash.cg1b + exphash.fin + exphash.end, - exphash.pfx + exphash.cg1b + exphash.cat + exphash.end, - exphash.pfx + exphash.cg1b + exphash.cat + exphash.fin + exphash.end, - exphash.pfx + exphash.cg1b + exphash.cg2 + exphash.end, - exphash.pfx + exphash.cg1b + exphash.cg2 + exphash.fin + exphash.end, - exphash.pfx + exphash.cg1b + exphash.cg2 + exphash.cat + exphash.end, - exphash.pfx + exphash.cg1b + exphash.cg2 + exphash.cat + exphash.fin + exphash.end, - ]; - - for (var i in src) { - print("\n=== " + i + ": " + src[i]); - var f = eval(src[i]); - var exp = eval(expsrc[i]); - // dis(f); - print('decompiling: ' + f); - //print('decompiling exp: ' + exp); - - actual = ''; - try { expect = exp(41); f(41) } catch (e) { print('tried f(41), caught ' + e) } - reportCompare(expect, actual, summary); - - actual = ''; - try { expect = exp(42); f(42) } catch (e) { print('tried f(42), caught ' + e) } - reportCompare(expect, actual, summary); - - actual = ''; - try { expect = exp(43); f(43) } catch (e) { print('tried f(43), caught ' + e) } - reportCompare(expect, actual, summary); - - actual = ''; - try { expect = exp(44); f(44) } catch (e) { print('tried f(44), caught ' + e) } - reportCompare(expect, actual, summary); - - actual = ''; - try { expect = exp(45); f(45) } catch (e) { print('tried f(44), caught ' + e) } - reportCompare(expect, actual, summary); - - } -} diff --git a/js/src/tests/js1_5/extensions/regress-351102-01.js b/js/src/tests/js1_5/extensions/regress-351102-01.js deleted file mode 100644 index 5dcff2bcdf8c..000000000000 --- a/js/src/tests/js1_5/extensions/regress-351102-01.js +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 351102; -var summary = 'try/catch-guard/finally GC issues'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - printBugNumber(BUGNUMBER); - printStatus (summary); - - var f; - - f = function () { - try { - throw new Error('bad'); - } catch (e if (e = null, gc(), false)) { - } catch (e) { - // e is dangling now - } - }; - - f(); - - reportCompare(expect, actual, summary + ': 1'); -} diff --git a/js/src/tests/js1_5/extensions/regress-351102-02.js b/js/src/tests/js1_5/extensions/regress-351102-02.js deleted file mode 100644 index 7e4ffcff7aab..000000000000 --- a/js/src/tests/js1_5/extensions/regress-351102-02.js +++ /dev/null @@ -1,43 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 351102; -var summary = 'try/catch-guard/finally GC issues'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - printBugNumber(BUGNUMBER); - printStatus (summary); - - var f; - f = function () - { - var a = null; - try { - a(); - } catch (e) { - } - return false; - }; - - try { - throw 1; - } catch (e if f()) { - } catch (e if e == 1) { - print("GOOD"); - } catch (e) { - print("BAD: "+e); - } - - reportCompare(expect, actual, summary + ': 2'); -} diff --git a/js/src/tests/js1_5/extensions/regress-351102-06.js b/js/src/tests/js1_5/extensions/regress-351102-06.js deleted file mode 100644 index fe014feea0e1..000000000000 --- a/js/src/tests/js1_5/extensions/regress-351102-06.js +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 351102; -var summary = 'try/catch-guard/finally GC issues'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - printBugNumber(BUGNUMBER); - printStatus (summary); - - var f; - try - { - try { null.a } catch(e if (e = null, gc())) { } - } - catch(ex) - { - } - reportCompare(expect, actual, summary + ': 6'); -} diff --git a/js/src/tests/js1_5/extensions/regress-374589.js b/js/src/tests/js1_5/extensions/regress-374589.js deleted file mode 100644 index dfb7bd0745da..000000000000 --- a/js/src/tests/js1_5/extensions/regress-374589.js +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 374589; -var summary = 'Do not assert decompiling try { } catch(x if true) { } ' + - 'catch(y) { } finally { this.a.b; }'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - printBugNumber(BUGNUMBER); - printStatus (summary); - - var f = function () { - try { } catch(x if true) { } catch(y) { } finally { this.a.b; } }; - - expect = 'function () {\n\ - try { } catch(x if true) { } catch(y) { } finally { this.a.b; } }'; - - actual = f + ''; - compareSource(expect, actual, summary); -} diff --git a/js/src/tests/js1_7/extensions/regress-351102-03.js b/js/src/tests/js1_7/extensions/regress-351102-03.js deleted file mode 100644 index 4500a6b05ddb..000000000000 --- a/js/src/tests/js1_7/extensions/regress-351102-03.js +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 351102; -var summary = 'try/catch-guard/finally GC issues'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - printBugNumber(BUGNUMBER); - printStatus (summary); - - var f; - f = function() - { - try - { - d.d.d; - } - catch({} if gc()) - { - } - catch(y) - { - } - }; - - f(); - f(); - - reportCompare(expect, actual, summary + ': 3'); -} diff --git a/js/src/tests/js1_7/extensions/regress-351102-04.js b/js/src/tests/js1_7/extensions/regress-351102-04.js deleted file mode 100644 index 5afabf3caf1d..000000000000 --- a/js/src/tests/js1_7/extensions/regress-351102-04.js +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 351102; -var summary = 'try/catch-guard/finally GC issues'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - printBugNumber(BUGNUMBER); - printStatus (summary); - - var f; - try - { - try { foo() } catch([] if gc()) { } - } - catch(ex) - { - } - reportCompare(expect, actual, summary + ': 4'); -} - diff --git a/js/src/tests/js1_7/extensions/regress-351102-05.js b/js/src/tests/js1_7/extensions/regress-351102-05.js deleted file mode 100644 index 8d566abc9a9d..000000000000 --- a/js/src/tests/js1_7/extensions/regress-351102-05.js +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 351102; -var summary = 'try/catch-guard/finally GC issues'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - printBugNumber(BUGNUMBER); - printStatus (summary); - - var f; - try - { - try { d.d.d } catch([] if gc()) { } - } - catch(ex) - { - } - reportCompare(expect, actual, summary + ': 5'); -} diff --git a/js/src/tests/js1_7/extensions/regress-351102-07.js b/js/src/tests/js1_7/extensions/regress-351102-07.js deleted file mode 100644 index 130b8a69d033..000000000000 --- a/js/src/tests/js1_7/extensions/regress-351102-07.js +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 351102; -var summary = 'try/catch-guard/finally GC issues'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - printBugNumber(BUGNUMBER); - printStatus (summary); - - var f; - var obj = { get a() { - try { - throw 1; - } catch (e) { - } - return false; - }}; - - try { - throw obj; - } catch ({a: a} if a) { - throw "Unreachable"; - } catch (e) { - if (e !== obj) - throw "Unexpected exception: "+uneval(e); - } - reportCompare(expect, actual, summary + ': 7'); -} diff --git a/js/src/tests/js1_7/regress/regress-375695.js b/js/src/tests/js1_7/regress/regress-375695.js deleted file mode 100644 index 5f4459d51ee8..000000000000 --- a/js/src/tests/js1_7/regress/regress-375695.js +++ /dev/null @@ -1,24 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -//----------------------------------------------------------------------------- -var BUGNUMBER = 375695; -var summary = 'Do not assert: !fp->blockChain || OBJ_GET_PARENT(cx, obj) == fp->blockChain'; -var actual = ''; -var expect = ''; - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - printBugNumber(BUGNUMBER); - printStatus (summary); - - try { try { throw 1 } catch([] if false) { } } catch(ex) {} - - reportCompare(expect, actual, summary); -} diff --git a/js/src/tests/js1_8_5/extensions/regress-677589.js b/js/src/tests/js1_8_5/extensions/regress-677589.js deleted file mode 100644 index 0bdb2e79ff37..000000000000 --- a/js/src/tests/js1_8_5/extensions/regress-677589.js +++ /dev/null @@ -1,10 +0,0 @@ -// |reftest| skip-if(!xulRuntime.shell) -// Any copyright is dedicated to the Public Domain. -// http://creativecommons.org/licenses/publicdomain/ - -try { - clone(null); // don't crash -} catch (exc if exc instanceof TypeError) { -} - -reportCompare(0, 0, 'ok');