mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1170716 - Part 3: Use getLastWarning in test for warning with JSEXN_NONE. r=jandem
This commit is contained in:
parent
e897dd83b1
commit
8d5e07d2d5
@ -10,8 +10,7 @@ m = new Map(null);
|
||||
assertEq(m.size, 0);
|
||||
|
||||
// FIXME: bug 1083752
|
||||
options("werror");
|
||||
assertEq(evaluate("Map()", {catchTermination: true}), "terminated");
|
||||
assertWarning(() => Map(), "None");
|
||||
// assertThrowsInstanceOf(() => Map(), TypeError);
|
||||
// assertThrowsInstanceOf(() => Map(undefined), TypeError);
|
||||
// assertThrowsInstanceOf(() => Map(null), TypeError);
|
||||
|
@ -10,8 +10,7 @@ s = new Set(null);
|
||||
assertEq(s.size, 0);
|
||||
|
||||
// FIXME: bug 1083752
|
||||
options("werror");
|
||||
assertEq(evaluate("Set()", {catchTermination: true}), "terminated");
|
||||
assertWarning(() => Set(), "None");
|
||||
// assertThrowsInstanceOf(() => Set(), TypeError);
|
||||
// assertThrowsInstanceOf(() => Set(undefined), TypeError);
|
||||
// assertThrowsInstanceOf(() => Set(null), TypeError);
|
||||
|
@ -7,8 +7,7 @@ new WeakMap(undefined);
|
||||
new WeakMap(null);
|
||||
|
||||
// FIXME: bug 1083752
|
||||
options("werror");
|
||||
assertEq(evaluate("WeakMap()", {catchTermination: true}), "terminated");
|
||||
assertWarning(() => WeakMap(), "None");
|
||||
// assertThrowsInstanceOf(() => WeakMap(), TypeError);
|
||||
// assertThrowsInstanceOf(() => WeakMap(undefined), TypeError);
|
||||
// assertThrowsInstanceOf(() => WeakMap(null), TypeError);
|
||||
|
@ -204,3 +204,14 @@ if (typeof assertDeepEq === 'undefined') {
|
||||
};
|
||||
})();
|
||||
}
|
||||
|
||||
if (typeof assertWarning === 'undefined') {
|
||||
function assertWarning(func, name) {
|
||||
enableLastWarning();
|
||||
func();
|
||||
var warning = getLastWarning();
|
||||
assertEq(warning !== null, true);
|
||||
assertEq(warning.name, name);
|
||||
disableLastWarning();
|
||||
}
|
||||
}
|
||||
|
@ -6,10 +6,19 @@ var summary = 'Add console warnings for non-standard flag argument of String.pro
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
options("werror");
|
||||
assertEq(evaluate("'aaaA'.match('a', 'i')", {catchTermination: true}), "terminated");
|
||||
assertEq(evaluate("'aaaA'.search('a', 'i')", {catchTermination: true}), "terminated");
|
||||
assertEq(evaluate("'aaaA'.replace('a', 'b', 'g')", {catchTermination: true}), "terminated");
|
||||
function assertWarningForComponent(code, name) {
|
||||
enableLastWarning();
|
||||
var g = newGlobal();
|
||||
g.eval(code);
|
||||
var warning = getLastWarning();
|
||||
assertEq(warning !== null, true);
|
||||
assertEq(warning.name, name);
|
||||
disableLastWarning();
|
||||
}
|
||||
|
||||
assertWarningForComponent(`'aaaA'.match('a', 'i');`, "None");
|
||||
assertWarningForComponent(`'aaaA'.search('a', 'i');`, "None");
|
||||
assertWarningForComponent(`'aaaA'.replace('a', 'b', 'g');`, "None");
|
||||
|
||||
if (typeof reportCompare === "function")
|
||||
reportCompare(true, true);
|
||||
|
Loading…
Reference in New Issue
Block a user