summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/for-of/array-holes-3.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/for-of/array-holes-3.js')
-rw-r--r--js/src/jit-test/tests/for-of/array-holes-3.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/for-of/array-holes-3.js b/js/src/jit-test/tests/for-of/array-holes-3.js
new file mode 100644
index 0000000000..9b4d087bde
--- /dev/null
+++ b/js/src/jit-test/tests/for-of/array-holes-3.js
@@ -0,0 +1,8 @@
+// for-of consults Array.prototype when it encounters a hole.
+
+Array.prototype[1] = 'peek';
+var log = [];
+for (var x of [0, , 2, 3])
+ log.push(x);
+assertEq(log[1], 'peek');
+assertEq(log.join(), "0,peek,2,3");