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

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

Issue 1689010: X64: Faster push/pop implementation. (Closed)
Patch Set: Addressed review comments. Created 10 years, 8 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/x64/stub-cache-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/array-pop.js
diff --git a/test/mjsunit/array-pop.js b/test/mjsunit/array-pop.js
index 9608cd4ce5acbbc51bb22d46f8930c85bdd5b359..a8d131e20facfa19bf3e66f21a3a9462f39c1bd0 100644
--- a/test/mjsunit/array-pop.js
+++ b/test/mjsunit/array-pop.js
@@ -58,6 +58,29 @@
assertEquals(undefined, a.pop(1, 2, 3), "9th pop");
assertEquals(0, a.length, "length 9th pop");
}
+
+ // Check that pop works on inherited properties.
+ for (var i = 0; i < 10 ;i++) { // Ensure ICs are stabilized.
+ Array.prototype[1] = 1;
+ Array.prototype[3] = 3;
+ Array.prototype[5] = 5;
+ Array.prototype[7] = 7;
+ Array.prototype[9] = 9;
+ a = [0,1,2,,4,,6,7,8,,];
+ assertEquals(10, a.length, "inherit-initial-length");
+ for (var j = 9; j >= 0; j--) {
+ assertEquals(j + 1, a.length, "inherit-pre-length-" + j);
+ assertTrue(j in a, "has property " + j);
+ var own = a.hasOwnProperty(j);
+ var inherited = Array.prototype.hasOwnProperty(j);
+ assertEquals(j, a.pop(), "inherit-pop");
+ assertEquals(j, a.length, "inherit-post-length");
+ assertFalse(a.hasOwnProperty(j), "inherit-deleted-own-" + j);
+ assertEquals(inherited, Array.prototype.hasOwnProperty(j),
+ "inherit-not-deleted-inherited" + j);
+ }
+ Array.prototype.length = 0; // Clean-up.
+ }
})();
// Test the case of not JSArray receiver.
« no previous file with comments | « src/x64/stub-cache-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698