| Index: src/api.cc
|
| diff --git a/src/api.cc b/src/api.cc
|
| index 59c56154fdda67be17658f029c18f201aec2d13a..f7ad1c3c7960b0ab8b89b4d4de1c45ec0c602e55 100644
|
| --- a/src/api.cc
|
| +++ b/src/api.cc
|
| @@ -2085,7 +2085,12 @@ MaybeLocal<Function> ScriptCompiler::CompileFunctionInContext(
|
| if (!extension->IsJSObject()) return Local<Function>();
|
| i::Handle<i::JSFunction> closure(context->closure(), isolate);
|
| context = factory->NewWithContext(
|
| - closure, context, i::ScopeInfo::CreateForWithScope(isolate), extension);
|
| + closure, context,
|
| + i::ScopeInfo::CreateForWithScope(
|
| + isolate, context->IsNativeContext()
|
| + ? i::Handle<i::ScopeInfo>::null()
|
| + : i::Handle<i::ScopeInfo>(context->scope_info())),
|
| + extension);
|
| }
|
|
|
| i::Handle<i::Object> name_obj;
|
|
|