Index: src/array.js |
diff --git a/src/array.js b/src/array.js |
index 7cf744bedf29fc9c138b848d8d66d9021cd8afa0..7fa07481ac4f34371afcda6a888e582071b2f6c2 100644 |
--- a/src/array.js |
+++ b/src/array.js |
@@ -1053,7 +1053,7 @@ function ArrayFilter(f, receiver) { |
} |
if (IS_NULL_OR_UNDEFINED(receiver)) { |
receiver = %GetDefaultReceiver(f) || receiver; |
- } else if (!IS_SPEC_OBJECT(receiver)) { |
+ } else if (!IS_SPEC_OBJECT(receiver) && %IsClassicModeFunction(f)) { |
receiver = ToObject(receiver); |
} |
@@ -1104,9 +1104,10 @@ function ArrayForEach(f, receiver) { |
} |
if (IS_NULL_OR_UNDEFINED(receiver)) { |
receiver = %GetDefaultReceiver(f) || receiver; |
- } else if (!IS_SPEC_OBJECT(receiver)) { |
+ } else if (!IS_SPEC_OBJECT(receiver) && %IsClassicModeFunction(f)) { |
receiver = ToObject(receiver); |
} |
+ |
if (%DebugCallbackSupportsStepping(f)) { |
for (var i = 0; i < length; i++) { |
if (i in array) { |
@@ -1147,7 +1148,7 @@ function ArraySome(f, receiver) { |
} |
if (IS_NULL_OR_UNDEFINED(receiver)) { |
receiver = %GetDefaultReceiver(f) || receiver; |
- } else if (!IS_SPEC_OBJECT(receiver)) { |
+ } else if (!IS_SPEC_OBJECT(receiver) && %IsClassicModeFunction(f)) { |
receiver = ToObject(receiver); |
} |
@@ -1190,7 +1191,7 @@ function ArrayEvery(f, receiver) { |
} |
if (IS_NULL_OR_UNDEFINED(receiver)) { |
receiver = %GetDefaultReceiver(f) || receiver; |
- } else if (!IS_SPEC_OBJECT(receiver)) { |
+ } else if (!IS_SPEC_OBJECT(receiver) && %IsClassicModeFunction(f)) { |
receiver = ToObject(receiver); |
} |
@@ -1232,7 +1233,7 @@ function ArrayMap(f, receiver) { |
} |
if (IS_NULL_OR_UNDEFINED(receiver)) { |
receiver = %GetDefaultReceiver(f) || receiver; |
- } else if (!IS_SPEC_OBJECT(receiver)) { |
+ } else if (!IS_SPEC_OBJECT(receiver) && %IsClassicModeFunction(f)) { |
receiver = ToObject(receiver); |
} |