Skip to content

Commit

Permalink
Fix node 10 compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
FelipeGdM committed Feb 1, 2021
1 parent 4b5324e commit fa8dd3c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gzbridge/GZNode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void GZNode::Init(Local<Object> exports)
GetMaterialScriptsMessage);

Local<Context> context = isolate->GetCurrentContext();
exports->Set(context, class_name, tpl->GetFunction(context).ToLocalChecked()).Check();
exports->Set(context, class_name, tpl->GetFunction(context).ToLocalChecked()).ToChecked();
}

/////////////////////////////////////////////////
Expand Down Expand Up @@ -136,7 +136,13 @@ void GZNode::SetConnected(const FunctionCallbackInfo<Value>& args)
Isolate* isolate = args.GetIsolate();

GZNode *obj = ObjectWrap::Unwrap<GZNode>(args.This());

#if NODE_MAJOR_VERSION<=10
Local<Context> context = isolate->GetCurrentContext();
bool value = args[0]->BooleanValue(context).ToChecked();
#else
bool value = args[0]->BooleanValue(isolate);
#endif
obj->gzIface->SetConnected(value);

return;
Expand Down

0 comments on commit fa8dd3c

Please sign in to comment.