| Index: src/runtime/runtime-scopes.cc
|
| diff --git a/src/runtime/runtime-scopes.cc b/src/runtime/runtime-scopes.cc
|
| index 4e512f97be11b73367bf2aa42bfc97ef0452579e..10cb075e1b31a00ce98cdba74fdea733a6be7730 100644
|
| --- a/src/runtime/runtime-scopes.cc
|
| +++ b/src/runtime/runtime-scopes.cc
|
| @@ -673,9 +673,8 @@ RUNTIME_FUNCTION(Runtime_NewScriptContext) {
|
| // Script contexts have a canonical empty function as their closure, not the
|
| // anonymous closure containing the global code. See
|
| // FullCodeGenerator::PushFunctionArgumentForContextAllocation.
|
| - Handle<JSFunction> closure(global_object->IsJSBuiltinsObject()
|
| - ? *function
|
| - : native_context->closure());
|
| + Handle<JSFunction> closure(function->IsBuiltin() ? *function
|
| + : native_context->closure());
|
| Handle<Context> result =
|
| isolate->factory()->NewScriptContext(closure, scope_info);
|
|
|
|
|