summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/for-of/array-holes-2.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/for-of/array-holes-2.js')
-rw-r--r--js/src/jit-test/tests/for-of/array-holes-2.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/for-of/array-holes-2.js b/js/src/jit-test/tests/for-of/array-holes-2.js
new file mode 100644
index 000000000..cc37aedf2
--- /dev/null
+++ b/js/src/jit-test/tests/for-of/array-holes-2.js
@@ -0,0 +1,8 @@
+// for-of consults Object.prototype when it encounters a hole.
+
+Object.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");