diff options
Diffstat (limited to 'src/node.h')
-rw-r--r-- | src/node.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/node.h b/src/node.h index 9b4dfa6e149..d9b070d14ad 100644 --- a/src/node.h +++ b/src/node.h @@ -366,9 +366,10 @@ inline void NODE_SET_METHOD(v8::Local<v8::Object> recv, v8::FunctionCallback callback) { v8::Isolate* isolate = v8::Isolate::GetCurrent(); v8::HandleScope handle_scope(isolate); + v8::Local<v8::Context> context = isolate->GetCurrentContext(); v8::Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(isolate, callback); - v8::Local<v8::Function> fn = t->GetFunction(); + v8::Local<v8::Function> fn = t->GetFunction(context).ToLocalChecked(); v8::Local<v8::String> fn_name = v8::String::NewFromUtf8(isolate, name, v8::NewStringType::kInternalized).ToLocalChecked(); fn->SetName(fn_name); |