diff options
Diffstat (limited to 'src/node_contextify.cc')
-rw-r--r-- | src/node_contextify.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/node_contextify.cc b/src/node_contextify.cc index 8b9fef5480..bbbbd27292 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -203,7 +203,8 @@ void ContextifyContext::Init(Environment* env, Local<Object> target) { Local<FunctionTemplate> function_template = FunctionTemplate::New(env->isolate()); function_template->InstanceTemplate()->SetInternalFieldCount(1); - env->set_script_data_constructor_function(function_template->GetFunction()); + env->set_script_data_constructor_function( + function_template->GetFunction(env->context()).ToLocalChecked()); env->SetMethod(target, "makeContext", MakeContext); env->SetMethod(target, "isContext", IsContext); @@ -608,7 +609,8 @@ class ContextifyScript : public BaseObject { env->SetProtoMethod(script_tmpl, "runInContext", RunInContext); env->SetProtoMethod(script_tmpl, "runInThisContext", RunInThisContext); - target->Set(class_name, script_tmpl->GetFunction()); + target->Set(class_name, + script_tmpl->GetFunction(env->context()).ToLocalChecked()); env->set_script_context_constructor_template(script_tmpl); } |