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

Unified Diff: test/mjsunit/regress/regress-builtinbust-6.js

Issue 254103002: Fix some more missing ToObject on Array.prototype. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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/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/regress/regress-builtinbust-6.js
diff --git a/test/mjsunit/regress/regress-builtinbust-6.js b/test/mjsunit/regress/regress-builtinbust-6.js
index 771f80a276ff813fb6d35527b1361e40f96bc976..d926bd0488ad73248896a07ef67026e768ec5ec2 100644
--- a/test/mjsunit/regress/regress-builtinbust-6.js
+++ b/test/mjsunit/regress/regress-builtinbust-6.js
@@ -6,32 +6,35 @@
var values = [ 23, 4.2, true, false, 0/0 ];
for (var i = 0; i < values.length; ++i) {
var v = values[i];
+ Array.prototype.join.call(v);
Array.prototype.pop.call(v);
Array.prototype.push.call(v);
+ Array.prototype.reverse.call(v);
Array.prototype.shift.call(v);
+ Array.prototype.slice.call(v);
+ Array.prototype.splice.call(v);
Array.prototype.unshift.call(v);
}
// Test that ToObject on primitive values is only called once.
var length_receiver, element_receiver;
-function length() { length_receiver = this; return 1; }
+function length() { length_receiver = this; return 2; }
function element() { element_receiver = this; return "x"; }
Object.defineProperty(Number.prototype, "length", { get:length, set:length });
Object.defineProperty(Number.prototype, "0", { get:element, set:element });
Object.defineProperty(Number.prototype, "1", { get:element, set:element });
+Object.defineProperty(Number.prototype, "2", { get:element, set:element });
+function test_receiver(expected, call_string) {
+ assertDoesNotThrow(call_string);
+ assertEquals(new Number(expected), length_receiver);
+ assertSame(length_receiver, element_receiver);
+}
-assertDoesNotThrow("Array.prototype.pop.call(23)");
-assertEquals(new Number(23), length_receiver);
-assertSame(length_receiver, element_receiver);
-
-assertDoesNotThrow("Array.prototype.push.call(42, 'y')");
-assertEquals(new Number(42), length_receiver);
-assertSame(length_receiver, element_receiver);
-
-assertDoesNotThrow("Array.prototype.shift.call(65)");
-assertEquals(new Number(65), length_receiver);
-assertSame(length_receiver, element_receiver);
-
-assertDoesNotThrow("Array.prototype.unshift.call(99, 'z')");
-assertEquals(new Number(99), length_receiver);
-assertSame(length_receiver, element_receiver);
+test_receiver(11, "Array.prototype.join.call(11)")
+test_receiver(23, "Array.prototype.pop.call(23)");
+test_receiver(42, "Array.prototype.push.call(42, 'y')");
+test_receiver(49, "Array.prototype.reverse.call(49)");
+test_receiver(65, "Array.prototype.shift.call(65)");
+test_receiver(77, "Array.prototype.slice.call(77, 1)");
+test_receiver(88, "Array.prototype.splice.call(88, 1, 1)");
+test_receiver(99, "Array.prototype.unshift.call(99, 'z')");
« no previous file with comments | « src/array.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698