blob: 0e5b559f3b1e0c96031cb197055984303665de6a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
// |reftest| skip-if(!this.hasOwnProperty('Iterator')) -- Iterator is not enabled unconditionally
const iter = (value) => Iterator.from({
next: () => value,
});
assertThrowsInstanceOf(() => iter(undefined).next(), TypeError);
assertThrowsInstanceOf(() => iter(null).next(), TypeError);
assertThrowsInstanceOf(() => iter(0).next(), TypeError);
assertThrowsInstanceOf(() => iter(false).next(), TypeError);
assertThrowsInstanceOf(() => iter('test').next(), TypeError);
assertThrowsInstanceOf(() => iter(Symbol('')).next(), TypeError);
if (typeof reportCompare === 'function')
reportCompare(0, 0);
|