Revision: 7043
Author: [email protected]
Date: Thu Mar  3 04:44:39 2011
Log: Undo change from .call to %_CallFunction.

The latter doesn't handle promotion of null/undefined to global object as
receiver for non-strict functions.

Review URL: http://codereview.chromium.org/6615013
http://code.google.com/p/v8/source/detail?r=7043

Modified:
 /branches/bleeding_edge/src/array.js

=======================================
--- /branches/bleeding_edge/src/array.js        Thu Mar  3 03:49:03 2011
+++ /branches/bleeding_edge/src/array.js        Thu Mar  3 04:44:39 2011
@@ -925,7 +925,7 @@
   for (var i = 0; i < length; i++) {
     var current = this[i];
     if (!IS_UNDEFINED(current) || i in this) {
-      if (%_CallFunction(receiver, current, i, this, f)) {
+      if (f.call(receiver, current, i, this)) {
         result[result_length++] = current;
       }
     }
@@ -944,7 +944,7 @@
   for (var i = 0; i < length; i++) {
     var current = this[i];
     if (!IS_UNDEFINED(current) || i in this) {
-      %_CallFunction(receiver, current, i, this, f);
+      f.call(receiver, current, i, this);
     }
   }
 }
@@ -962,7 +962,7 @@
   for (var i = 0; i < length; i++) {
     var current = this[i];
     if (!IS_UNDEFINED(current) || i in this) {
-      if (%_CallFunction(receiver, current, i, this, f)) return true;
+      if (f.call(receiver, current, i, this)) return true;
     }
   }
   return false;
@@ -979,7 +979,7 @@
   for (var i = 0; i < length; i++) {
     var current = this[i];
     if (!IS_UNDEFINED(current) || i in this) {
-      if (!%_CallFunction(receiver, current, i, this, f)) return false;
+      if (!f.call(receiver, current, i, this)) return false;
     }
   }
   return true;
@@ -997,7 +997,7 @@
   for (var i = 0; i < length; i++) {
     var current = this[i];
     if (!IS_UNDEFINED(current) || i in this) {
-      accumulator[i] = %_CallFunction(receiver, current, i, this, f);
+      accumulator[i] = f.call(receiver, current, i, this);
     }
   }
   %MoveArrayContents(accumulator, result);

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to