diff options
Diffstat (limited to '')
-rw-r--r-- | js/src/tests/non262/Iterator/prototype/toArray/this-not-iterator-throws.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/js/src/tests/non262/Iterator/prototype/toArray/this-not-iterator-throws.js b/js/src/tests/non262/Iterator/prototype/toArray/this-not-iterator-throws.js new file mode 100644 index 0000000000..1442d22557 --- /dev/null +++ b/js/src/tests/non262/Iterator/prototype/toArray/this-not-iterator-throws.js @@ -0,0 +1,8 @@ +// |reftest| skip-if(!this.hasOwnProperty('Iterator')) -- Iterator is not enabled unconditionally + +assertThrowsInstanceOf(Iterator.prototype.toArray.bind(undefined), TypeError); +assertThrowsInstanceOf(Iterator.prototype.toArray.bind({}), TypeError); +assertThrowsInstanceOf(Iterator.prototype.toArray.bind({next: 0}), TypeError); + +if (typeof reportCompare === 'function') + reportCompare(0, 0); |