Commit 30c0420b authored by lrn@chromium.org's avatar lrn@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7043 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5a40de9b
......@@ -925,7 +925,7 @@ function ArrayFilter(f, receiver) {
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 @@ function ArrayForEach(f, receiver) {
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 @@ function ArraySome(f, receiver) {
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 @@ function ArrayEvery(f, receiver) {
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 @@ function ArrayMap(f, receiver) {
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment