mirror of
https://github.com/tc39/test262.git
synced 2025-09-25 02:57:53 +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/. */
|
||||
|
||||
/*---
|
||||
defines: [assertThrowsValue, assertThrownErrorContains, assertThrowsInstanceOfWithMessageCheck, assertThrowsInstanceOf, assertThrowsInstanceOfWithMessage, assertThrowsInstanceOfWithMessageContains, assertDeepEq]
|
||||
defines: [assertThrowsValue, assertThrownErrorContains, assertThrowsInstanceOfWithMessageCheck, assertThrowsInstanceOf, assertThrowsInstanceOfWithMessage]
|
||||
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.
|
||||
|
||||
/*---
|
||||
includes: [sm/non262.js, sm/non262-shell.js]
|
||||
flags:
|
||||
- noStrict
|
||||
description: |
|
||||
pending
|
||||
esid: pending
|
||||
@ -12,18 +9,16 @@ esid: pending
|
||||
var BUGNUMBER = 1391519;
|
||||
var summary = "for-await-of outside of async function should provide better error";
|
||||
|
||||
print(BUGNUMBER + ": " + summary);
|
||||
|
||||
assertThrowsInstanceOfWithMessageContains(
|
||||
() => eval("for await (let x of []) {}"),
|
||||
assert.throws(
|
||||
SyntaxError,
|
||||
() => eval("for await (let x of []) {}"),
|
||||
"for await (... of ...) is only valid in"
|
||||
);
|
||||
|
||||
// Extra `await` shouldn't throw that error.
|
||||
assertThrowsInstanceOfWithMessageContains(
|
||||
() => eval("async function f() { for await await (let x of []) {} }"),
|
||||
assert.throws(
|
||||
SyntaxError,
|
||||
() => eval("async function f() { for await await (let x of []) {} }"),
|
||||
"missing ( after for"
|
||||
);
|
||||
|
||||
|
@ -125,9 +125,9 @@ function test() {
|
||||
// IteratorClose expects iter.return to return an Object.
|
||||
var g6 = y();
|
||||
g6.next();
|
||||
assertThrowsInstanceOfWithMessageContains(
|
||||
() => g6.throw("foo"),
|
||||
assert.throws(
|
||||
TypeError,
|
||||
() => g6.throw("foo"),
|
||||
"non-object"
|
||||
);
|
||||
assert.sameValue(returnCalled, ++returnCalledExpected);
|
||||
|
Loading…
x
Reference in New Issue
Block a user