summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Iterator/prototype/reduce/this-not-iterator-throws.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/non262/Iterator/prototype/reduce/this-not-iterator-throws.js')
-rw-r--r--js/src/tests/non262/Iterator/prototype/reduce/this-not-iterator-throws.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/js/src/tests/non262/Iterator/prototype/reduce/this-not-iterator-throws.js b/js/src/tests/non262/Iterator/prototype/reduce/this-not-iterator-throws.js
new file mode 100644
index 0000000000..d4804c51e2
--- /dev/null
+++ b/js/src/tests/non262/Iterator/prototype/reduce/this-not-iterator-throws.js
@@ -0,0 +1,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);