diff --git a/js/src/tests/ecma_3/Exceptions/15.11.5.js b/js/src/tests/ecma_3/Exceptions/15.11.5.js index 06902708a85..f61d74ecdc5 100644 --- a/js/src/tests/ecma_3/Exceptions/15.11.5.js +++ b/js/src/tests/ecma_3/Exceptions/15.11.5.js @@ -21,15 +21,16 @@ function test() enterFunc ('test'); printStatus (summary); - var actual = ''; - var expect = 'TypeError: Error.prototype is not a constructor'; + var actual = { name: "no error", message: "no message" }; try { new Error.prototype; } catch (e) { - actual = '' + e; + actual = e; } - reportCompare(actual, expect, "not a constructor"); + reportCompare("TypeError", actual.name, "must be a TypeError"); + reportCompare(true, /not a constructor/.test(actual.message), + "message must indicate not a constructor"); exitFunc ('test'); } diff --git a/js/src/tests/js1_5/extensions/regress-429739.js b/js/src/tests/js1_5/extensions/regress-429739.js index 8d8a20ccec1..fd38b9efe6c 100644 --- a/js/src/tests/js1_5/extensions/regress-429739.js +++ b/js/src/tests/js1_5/extensions/regress-429739.js @@ -6,8 +6,6 @@ //----------------------------------------------------------------------------- var BUGNUMBER = 429739; var summary = 'Do not assert: OBJ_GET_CLASS(cx, obj)->flags & JSCLASS_HAS_PRIVATE'; -var actual = ''; -var expect = ''; //----------------------------------------------------------------------------- test(); @@ -18,20 +16,21 @@ function test() enterFunc ('test'); printBugNumber(BUGNUMBER); printStatus (summary); - - expect = 'TypeError: o.y is not a constructor'; + var actual; try { var o = { __noSuchMethod__: Function }; actual = (new o.y) + ''; + throw new Error("didn't throw, produced a value"); } catch(ex) { - actual = ex + ''; + actual = ex; } - reportCompare(expect, actual, summary); + reportCompare("TypeError", actual.name, "bad error name"); + reportCompare(true, /is not a constructor/.test(actual), summary); exitFunc ('test'); }