| Index: src/runtime.cc
|
| diff --git a/src/runtime.cc b/src/runtime.cc
|
| index d49cb108293d18bf29e85790c322c14c743f15db..86860fa8a71e4a8f4a0ac722bf1bf3f8ad2a0234 100644
|
| --- a/src/runtime.cc
|
| +++ b/src/runtime.cc
|
| @@ -1866,10 +1866,19 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SpecialArrayFunctions) {
|
| }
|
|
|
|
|
| -RUNTIME_FUNCTION(MaybeObject*, Runtime_GetGlobalReceiver) {
|
| - // Returns a real global receiver, not one of builtins object.
|
| +RUNTIME_FUNCTION(MaybeObject*, Runtime_GetDefaultReceiver) {
|
| + NoHandleAllocation handle_free;
|
| + ASSERT(args.length() == 1);
|
| + CONVERT_CHECKED(JSFunction, function, args[0]);
|
| + SharedFunctionInfo* shared = function->shared();
|
| + if (shared->native() || shared->strict_mode()) {
|
| + return isolate->heap()->undefined_value();
|
| + }
|
| + // Returns undefined for strict or native functions, or
|
| + // the associated global receiver for "normal" functions.
|
| +
|
| Context* global_context =
|
| - isolate->context()->global()->global_context();
|
| + function->context()->global()->global_context();
|
| return global_context->global()->global_receiver();
|
| }
|
|
|
|
|