Index: src/string.js |
diff --git a/src/string.js b/src/string.js |
index 08fccc4f05068d3171571f3c1df2c2b89c97f47b..a70eeade83b9d68b51937611b621b628fa6be286 100644 |
--- a/src/string.js |
+++ b/src/string.js |
@@ -251,8 +251,7 @@ function StringReplace(search, replace) { |
// Compute the string to replace with. |
if (IS_FUNCTION(replace)) { |
- var receiver = |
- %_IsNativeOrStrictMode(replace) ? void 0 : %GetGlobalReceiver(); |
+ var receiver = %GetDefaultReceiver(replace); |
builder.add(%_CallFunction(receiver, |
search, |
start, |
@@ -420,8 +419,7 @@ function StringReplaceGlobalRegExpWithFunction(subject, regexp, replace) { |
if (NUMBER_OF_CAPTURES(lastMatchInfo) == 2) { |
var match_start = 0; |
var override = new InternalArray(null, 0, subject); |
- var receiver = |
- %_IsNativeOrStrictMode(replace) ? void 0 : %GetGlobalReceiver(); |
+ var receiver = %GetDefaultReceiver(replace); |
while (i < len) { |
var elem = res[i]; |
if (%_IsSmi(elem)) { |
@@ -478,8 +476,7 @@ function StringReplaceNonGlobalRegExpWithFunction(subject, regexp, replace) { |
// No captures, only the match, which is always valid. |
var s = SubString(subject, index, endOfMatch); |
// Don't call directly to avoid exposing the built-in global object. |
- var receiver = |
- %_IsNativeOrStrictMode(replace) ? void 0 : %GetGlobalReceiver(); |
+ var receiver = %GetDefaultReceiver(replace); |
replacement = |
%_CallFunction(receiver, s, index, subject, replace); |
} else { |