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

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

Issue 844006: Merge changes up to V8 version 2.1.3 into the partial snapshots (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/partial_snapshots/
Patch Set: Created 10 years, 9 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-elements-from-object-prototype.js ('k') | test/mjsunit/array-slice.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/array-length.js
===================================================================
--- test/mjsunit/array-length.js (revision 3964)
+++ test/mjsunit/array-length.js (working copy)
@@ -26,7 +26,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
var a = [0,1,2,3];
-a.length = 0;
+assertEquals(0, a.length = 0);
assertEquals('undefined', typeof a[0]);
assertEquals('undefined', typeof a[1]);
@@ -35,7 +35,7 @@
var a = [0,1,2,3];
-a.length = 2;
+assertEquals(2, a.length = 2);
assertEquals(0, a[0]);
assertEquals(1, a[1]);
@@ -50,7 +50,7 @@
a[2000000] = 2000000;
assertEquals(2000001, a.length);
-a.length = 0;
+assertEquals(0, a.length = 0);
assertEquals(0, a.length);
assertEquals('undefined', typeof a[0]);
assertEquals('undefined', typeof a[1000]);
@@ -65,7 +65,7 @@
a[2000000] = 2000000;
assertEquals(2000001, a.length);
-a.length = 2000;
+assertEquals(2000, a.length = 2000);
assertEquals(2000, a.length);
assertEquals(0, a[0]);
assertEquals(1000, a[1000]);
@@ -91,7 +91,7 @@
assertEquals(Math.pow(2,32)-2, a[Math.pow(2,32)-2]);
assertEquals(Math.pow(2,32)-1, a.length);
-a.length = Math.pow(2,30)+1; // not a smi!
+assertEquals(Math.pow(2,30) + 1, a.length = Math.pow(2,30)+1); // not a smi!
assertEquals(Math.pow(2,30)+1, a.length);
assertEquals(0, a[0]);
@@ -102,10 +102,20 @@
var a = new Array();
-a.length = new Number(12);
+assertEquals(12, a.length = new Number(12));
assertEquals(12, a.length);
var o = { length: -23 };
Array.prototype.pop.apply(o);
assertEquals(4294967272, o.length);
+
+// Check case of compiled stubs.
+var a = [];
+for (var i = 0; i < 7; i++) {
+ assertEquals(3, a.length = 3);
+
+ var t = 239;
+ t = a.length = 7;
+ assertEquals(7, t);
+}
« no previous file with comments | « test/mjsunit/array-elements-from-object-prototype.js ('k') | test/mjsunit/array-slice.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698