Reviewers: Mads Ager,

Description:
More cases of CallFunction that doesn't work correctly.

Please review this at http://codereview.chromium.org/6603015/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge/build-ia32

Affected files:
  M src/array.js


Index: src/array.js
diff --git a/src/array.js b/src/array.js
index 97ce10dd85e0870e0f644cb7fef4dc475ceb5732..6ed1476080d49c5d1e552d63011c34964e798ea8 100644
--- a/src/array.js
+++ b/src/array.js
@@ -1138,7 +1138,7 @@ function ArrayReduce(callback, current) {
   for (; i < length; i++) {
     var element = this[i];
     if (!IS_UNDEFINED(element) || i in this) {
-      current = %_CallFunction(null, current, element, i, this, callback);
+      current = callback.call(null, current, element, i, this);
     }
   }
   return current;
@@ -1164,7 +1164,7 @@ function ArrayReduceRight(callback, current) {
   for (; i >= 0; i--) {
     var element = this[i];
     if (!IS_UNDEFINED(element) || i in this) {
-      current = %_CallFunction(null, current, element, i, this, callback);
+      current = callback.call(null, current, element, i, this);
     }
   }
   return current;


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

Reply via email to