Bug 1178653 - Fix a few more tests for modified error messages. r=bustage in a CLOSED TREE

This commit is contained in:
Jeff Walden 2015-08-18 13:47:49 -07:00
parent 4988b3ef27
commit 2b632ab6bc
2 changed files with 10 additions and 10 deletions

View File

@ -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');
}

View File

@ -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();
@ -19,19 +17,20 @@ function 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');
}