summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Iterator/prototype/toArray/iterator-empty.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--js/src/tests/non262/Iterator/prototype/toArray/iterator-empty.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/js/src/tests/non262/Iterator/prototype/toArray/iterator-empty.js b/js/src/tests/non262/Iterator/prototype/toArray/iterator-empty.js
new file mode 100644
index 0000000000..97c14f0d06
--- /dev/null
+++ b/js/src/tests/non262/Iterator/prototype/toArray/iterator-empty.js
@@ -0,0 +1,10 @@
+// |reftest| skip-if(!this.hasOwnProperty('Iterator')) -- Iterator is not enabled unconditionally
+
+const iter = [].values();
+const array = iter.toArray();
+
+assertEq(Array.isArray(array), true);
+assertEq(array.length, 0);
+
+if (typeof reportCompare === 'function')
+ reportCompare(0, 0);