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

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

Issue 417953004: Revert 22595: "Keep new arrays allocated with 'new Array(N)' in fast mode" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 | « test/mjsunit/array-splice.js ('k') | test/mjsunit/elements-kind.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/array-unshift.js
diff --git a/test/mjsunit/array-unshift.js b/test/mjsunit/array-unshift.js
index 4d0c18e7e3de69a160be6fc23768854d05a93f39..0eb299a0cee2a145396c2e7036d2237667c256c7 100644
--- a/test/mjsunit/array-unshift.js
+++ b/test/mjsunit/array-unshift.js
@@ -194,9 +194,7 @@
(function() {
for (var i = 0; i < 7; i++) {
try {
- var a1 = [];
- a1[Math.pow(2, 32) - 3 - 1] = 0;
- a1.unshift(1, 2, 3, 4, 5);
+ new Array(Math.pow(2, 32) - 3).unshift(1, 2, 3, 4, 5);
throw 'Should have thrown RangeError';
} catch (e) {
assertTrue(e instanceof RangeError);
@@ -204,9 +202,7 @@
// Check smi boundary
var bigNum = (1 << 30) - 3;
- var a2 = [];
- a2[bigNum - 1] = 0;
- assertEquals(bigNum + 7, a2.unshift(1, 2, 3, 4, 5, 6, 7));
+ assertEquals(bigNum + 7, new Array(bigNum).unshift(1, 2, 3, 4, 5, 6, 7));
}
})();
« no previous file with comments | « test/mjsunit/array-splice.js ('k') | test/mjsunit/elements-kind.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698