blob: 32797fe7508d62d6287ac44792955f2f2d4fd807 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
// |reftest| skip-if(!this.hasOwnProperty('AsyncIterator'))
const otherGlobal = newGlobal({newCompartment: true});
assertEq(TypeError !== otherGlobal.TypeError, true);
async function *gen() {}
gen().forEach().then(() => assertEq(true, false, 'expected error'), err => {
assertEq(err instanceof TypeError, true);
});
otherGlobal.AsyncIterator.prototype.forEach.call(gen()).then(() => assertEq(true, false, 'expected error'), err => {
assertEq(
err instanceof otherGlobal.TypeError,
true,
'TypeError comes from the realm of the method.',
);
});
if (typeof reportCompare === 'function')
reportCompare(0, 0);
|