Index: test/mjsunit/array-join.js |
diff --git a/test/mjsunit/array-join.js b/test/mjsunit/array-join.js |
index c08c182feee3e821fa5fcc4bd3a30314cd672f1f..0c949e769a801a9b89038c9c648e53d27f2b91d9 100644 |
--- a/test/mjsunit/array-join.js |
+++ b/test/mjsunit/array-join.js |
@@ -91,3 +91,16 @@ for (var i = 0; i < a.length; i++) a[i] = undefined; |
a[5] = "ab"; |
a[90000] = "cd"; |
assertEquals("abcd", a.join("")); // Must not throw. |
+ |
+ |
+// Make sure that each element is accessed exactly once, and in the correct |
+// order. |
+{ |
+ var log = []; |
+ var p = new Proxy({length: 3, 0: 'a', 1: 'b'}, { |
+ get: function(t, k, r) { log.push(k); return Reflect.get(t, k, r); } |
+ }); |
+ |
+ assertEquals("a,b,", Array.prototype.join.call(p)); |
+ assertEquals(["length", "0", "1", "2"], log); |
+} |