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

const fn = x => x;
assertThrowsInstanceOf(Iterator.prototype.find.bind(undefined, fn), TypeError);
assertThrowsInstanceOf(Iterator.prototype.find.bind({}, fn), TypeError);
assertThrowsInstanceOf(Iterator.prototype.find.bind({next: 0}, fn), TypeError);

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