mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1178653 - Fix a few more tests for modified error messages. r=bustage in a CLOSED TREE
This commit is contained in:
parent
4988b3ef27
commit
2b632ab6bc
@ -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');
|
||||
}
|
||||
|
@ -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');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user