mirror of
https://github.com/tc39/test262.git
synced 2025-09-25 19:18:48 +02:00
Remove assertThrowsInstanceOfWithMessageContains
This commit is contained in:
parent
8e9f51e944
commit
b5f946440f
@ -5,7 +5,7 @@
|
|||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
defines: [assertThrowsValue, assertThrownErrorContains, assertThrowsInstanceOfWithMessageCheck, assertThrowsInstanceOf, assertThrowsInstanceOfWithMessage, assertThrowsInstanceOfWithMessageContains, assertDeepEq]
|
defines: [assertThrowsValue, assertThrownErrorContains, assertThrowsInstanceOfWithMessageCheck, assertThrowsInstanceOf, assertThrowsInstanceOfWithMessage]
|
||||||
allow_unused: True
|
allow_unused: True
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
@ -77,10 +77,4 @@ allow_unused: True
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof globalThis.assertThrowsInstanceOfWithMessageContains === 'undefined') {
|
|
||||||
globalThis.assertThrowsInstanceOfWithMessageContains = function assertThrowsInstanceOfWithMessageContains(f, ctor, substr, msg) {
|
|
||||||
assertThrowsInstanceOfWithMessageCheck(f, ctor, message => message.indexOf(substr) !== -1, msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
@ -2,9 +2,6 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
includes: [sm/non262.js, sm/non262-shell.js]
|
|
||||||
flags:
|
|
||||||
- noStrict
|
|
||||||
description: |
|
description: |
|
||||||
pending
|
pending
|
||||||
esid: pending
|
esid: pending
|
||||||
@ -12,18 +9,16 @@ esid: pending
|
|||||||
var BUGNUMBER = 1391519;
|
var BUGNUMBER = 1391519;
|
||||||
var summary = "for-await-of outside of async function should provide better error";
|
var summary = "for-await-of outside of async function should provide better error";
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
assert.throws(
|
||||||
|
|
||||||
assertThrowsInstanceOfWithMessageContains(
|
|
||||||
() => eval("for await (let x of []) {}"),
|
|
||||||
SyntaxError,
|
SyntaxError,
|
||||||
|
() => eval("for await (let x of []) {}"),
|
||||||
"for await (... of ...) is only valid in"
|
"for await (... of ...) is only valid in"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Extra `await` shouldn't throw that error.
|
// Extra `await` shouldn't throw that error.
|
||||||
assertThrowsInstanceOfWithMessageContains(
|
assert.throws(
|
||||||
() => eval("async function f() { for await await (let x of []) {} }"),
|
|
||||||
SyntaxError,
|
SyntaxError,
|
||||||
|
() => eval("async function f() { for await await (let x of []) {} }"),
|
||||||
"missing ( after for"
|
"missing ( after for"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -125,9 +125,9 @@ function test() {
|
|||||||
// IteratorClose expects iter.return to return an Object.
|
// IteratorClose expects iter.return to return an Object.
|
||||||
var g6 = y();
|
var g6 = y();
|
||||||
g6.next();
|
g6.next();
|
||||||
assertThrowsInstanceOfWithMessageContains(
|
assert.throws(
|
||||||
() => g6.throw("foo"),
|
|
||||||
TypeError,
|
TypeError,
|
||||||
|
() => g6.throw("foo"),
|
||||||
"non-object"
|
"non-object"
|
||||||
);
|
);
|
||||||
assert.sameValue(returnCalled, ++returnCalledExpected);
|
assert.sameValue(returnCalled, ++returnCalledExpected);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user