Skip to content

Commit 4d1d63e

Browse files
committed
Fix node 10 compilation errors
1 parent 6757476 commit 4d1d63e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

gzbridge/GZNode.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ void GZNode::Init(Local<Object> exports)
8585
GetMaterialScriptsMessage);
8686

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

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

138138
GZNode *obj = ObjectWrap::Unwrap<GZNode>(args.This());
139+
140+
#if NODE_MAJOR_VERSION<=10
141+
Local<Context> context = isolate->GetCurrentContext();
142+
bool value = args[0]->BooleanValue(context).ToChecked();
143+
#else
139144
bool value = args[0]->BooleanValue(isolate);
145+
#endif
140146
obj->gzIface->SetConnected(value);
141147

142148
return;

0 commit comments

Comments
 (0)