diff options
Diffstat (limited to 'js/src/tests/non262/Iterator/prototype/reduce/empty-iterator-without-initial-value-throws.js')
-rw-r--r-- | js/src/tests/non262/Iterator/prototype/reduce/empty-iterator-without-initial-value-throws.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/js/src/tests/non262/Iterator/prototype/reduce/empty-iterator-without-initial-value-throws.js b/js/src/tests/non262/Iterator/prototype/reduce/empty-iterator-without-initial-value-throws.js new file mode 100644 index 0000000000..d8e0a595cf --- /dev/null +++ b/js/src/tests/non262/Iterator/prototype/reduce/empty-iterator-without-initial-value-throws.js @@ -0,0 +1,7 @@ +// |reftest| skip-if(!this.hasOwnProperty('Iterator')) -- Iterator is not enabled unconditionally + +const iter = [].values(); +assertThrowsInstanceOf(() => iter.reduce((x, y) => x + y), TypeError); + +if (typeof reportCompare === 'function') + reportCompare(0, 0); |