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

Unified Diff: test/mjsunit/es6/mirror-collections.js

Issue 712083002: Add optional max elements limit for Map/Set mirror iterator preview. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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/runtime/runtime-collections.cc ('k') | test/mjsunit/es6/mirror-iterators.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/mirror-collections.js
diff --git a/test/mjsunit/es6/mirror-collections.js b/test/mjsunit/es6/mirror-collections.js
index e10f5c1a981fca68974662984b0387dc85b80776..81a98b8a58aaa786ebd016578d36aac31af7f2eb 100644
--- a/test/mjsunit/es6/mirror-collections.js
+++ b/test/mjsunit/es6/mirror-collections.js
@@ -51,6 +51,7 @@ map.set(o2, 22);
map.delete(o1);
var mapMirror = debug.MakeMirror(map);
testMapMirror(mapMirror);
+
var entries = mapMirror.entries();
assertEquals(1, entries.length);
assertSame(o2, entries[0].key);
@@ -59,6 +60,7 @@ map.set(o1, 33);
map.set(o3, o2);
map.delete(o2);
map.set(undefined, 44);
+
entries = mapMirror.entries();
assertEquals(3, entries.length);
assertSame(o1, entries[0].key);
@@ -68,6 +70,10 @@ assertSame(o2, entries[1].value);
assertEquals(undefined, entries[2].key);
assertEquals(44, entries[2].value);
+assertEquals(3, mapMirror.entries(0).length);
+assertEquals(1, mapMirror.entries(1).length);
+assertEquals(2, mapMirror.entries(2).length);
+
// Test the mirror object for Sets
var set = new Set();
set.add(o1);
@@ -78,6 +84,7 @@ var setMirror = debug.MakeMirror(set);
testSetMirror(setMirror);
var values = setMirror.values();
assertEquals(2, values.length);
+assertEquals(1, setMirror.values(1).length);
assertSame(o2, values[0]);
assertEquals(undefined, values[1]);
@@ -96,6 +103,8 @@ gc();
function testWeakMapEntries(weakMapMirror) {
var entries = weakMapMirror.entries();
assertEquals(2, entries.length);
+ assertEquals(2, weakMapMirror.entries(0).length);
+ assertEquals(1, weakMapMirror.entries(1).length);
var found = 0;
for (var i = 0; i < entries.length; i++) {
if (Object.is(entries[i].key, o1)) {
@@ -129,6 +138,8 @@ gc();
function testWeakSetValues(weakSetMirror) {
var values = weakSetMirror.values();
assertEquals(2, values.length);
+ assertEquals(2, weakSetMirror.values(0).length);
+ assertEquals(1, weakSetMirror.values(1).length);
var found = 0;
for (var i = 0; i < values.length; i++) {
if (Object.is(values[i], o1)) {
« no previous file with comments | « src/runtime/runtime-collections.cc ('k') | test/mjsunit/es6/mirror-iterators.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698