summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Iterator/prototype/toArray/next-throws.js
blob: c93ecdd3241df4be640dbba46f124cdef0ade4f7 (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

class TestIterator extends Iterator {
  next() {
    throw new Error();
  }
}

const iter = new TestIterator();

assertThrowsInstanceOf(() => iter.toArray(), Error);

if (typeof reportCompare === 'function')
  reportCompare(0, 0);