diff options
Diffstat (limited to 'src/node_file.cc')
-rw-r--r-- | src/node_file.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/node_file.cc b/src/node_file.cc index 07d5966962b..c073c28b2e1 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -2240,7 +2240,10 @@ void Initialize(Local<Object> target, Local<String> wrapString = FIXED_ONE_BYTE_STRING(env->isolate(), "FSReqCallback"); fst->SetClassName(wrapString); - target->Set(context, wrapString, fst->GetFunction()).FromJust(); + target + ->Set(context, wrapString, + fst->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); // Create FunctionTemplate for FileHandleReadWrap. There’s no need // to do anything in the constructor, so we only store the instance template. @@ -2274,7 +2277,10 @@ void Initialize(Local<Object> target, FIXED_ONE_BYTE_STRING(env->isolate(), "FileHandle"); fd->SetClassName(handleString); StreamBase::AddMethods<FileHandle>(env, fd); - target->Set(context, handleString, fd->GetFunction()).FromJust(); + target + ->Set(context, handleString, + fd->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); env->set_fd_constructor_template(fdt); // Create FunctionTemplate for FileHandle::CloseReq |