diff options
Diffstat (limited to 'src/node_api.cc')
-rw-r--r-- | src/node_api.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/node_api.cc b/src/node_api.cc index 3dd5b383310..83eef0ff2ee 100644 --- a/src/node_api.cc +++ b/src/node_api.cc @@ -1518,7 +1518,9 @@ napi_status napi_define_class(napi_env env, } } - *result = v8impl::JsValueFromV8LocalValue(scope.Escape(tpl->GetFunction())); + v8::Local<v8::Context> context = isolate->GetCurrentContext(); + *result = v8impl::JsValueFromV8LocalValue( + scope.Escape(tpl->GetFunction(context).ToLocalChecked())); if (static_property_count > 0) { std::vector<napi_property_descriptor> static_descriptors; |