summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Iterator/prototype/reduce/this-not-iterator-throws.js
blob: d4804c51e26999febc3fd40cba595473f83bf410 (plain)
1
2
3
4
5
6
7
8
9
// |reftest| skip-if(!this.hasOwnProperty('Iterator')) -- Iterator is not enabled unconditionally

const sum = (x, y) => x + y;
assertThrowsInstanceOf(Iterator.prototype.reduce.bind(undefined, sum), TypeError);
assertThrowsInstanceOf(Iterator.prototype.reduce.bind({}, sum), TypeError);
assertThrowsInstanceOf(Iterator.prototype.reduce.bind({next: 0}, sum), TypeError);

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