summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Iterator/prototype/toArray/next-throws.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--js/src/tests/non262/Iterator/prototype/toArray/next-throws.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/js/src/tests/non262/Iterator/prototype/toArray/next-throws.js b/js/src/tests/non262/Iterator/prototype/toArray/next-throws.js
new file mode 100644
index 0000000000..c93ecdd324
--- /dev/null
+++ b/js/src/tests/non262/Iterator/prototype/toArray/next-throws.js
@@ -0,0 +1,14 @@
+// |reftest| skip-if(!this.hasOwnProperty('Iterator')) -- Iterator is not enabled unconditionally
+
+class TestIterator extends Iterator {
+ next() {
+ throw new Error();
+ }
+}
+
+const iter = new TestIterator();
+
+assertThrowsInstanceOf(() => iter.toArray(), Error);
+
+if (typeof reportCompare === 'function')
+ reportCompare(0, 0);