Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(433)

Unified Diff: test/mjsunit/array-join.js

Issue 1747933002: Fix spec-compliance bug in Array.prototype.join. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/js/array.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+}
« no previous file with comments | « src/js/array.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698