blob: 90328d117d0914cec12eb0339c0d75e8ae138137 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
// |reftest| skip-if(!this.hasOwnProperty('Iterator')) -- Iterator is not enabled unconditionally
const iter = {
next: () => ({done: false, value: 0}),
};
const wrap = Iterator.from.call(undefined, iter);
const result = wrap.next();
assertEq(result.done, false);
assertEq(result.value, 0);
const returnResult = wrap.return(1);
assertEq(returnResult.done, true);
assertEq(returnResult.value, 1);
assertThrowsInstanceOf(() => wrap.throw(new Error()), Error);
if (typeof reportCompare === 'function')
reportCompare(0, 0);
|