Skip to content

Commit

Permalink
fix node v12
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiask88 committed May 11, 2019
1 parent 73892c1 commit a0cd99d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/node_snap7_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ NAN_MODULE_INIT(S7Client::Init) {
, v8::ReadOnly);

constructor.Reset(tpl);
Nan::Set(target, name, tpl->GetFunction());
Nan::Set(target, name, Nan::GetFunction(tpl).ToLocalChecked());
}

NAN_METHOD(S7Client::New) {
Expand All @@ -707,7 +707,7 @@ NAN_METHOD(S7Client::New) {
v8::Local<v8::FunctionTemplate> constructorHandle;
constructorHandle = Nan::New<v8::FunctionTemplate>(constructor);
info.GetReturnValue().Set(
Nan::NewInstance(constructorHandle->GetFunction()).ToLocalChecked());
Nan::NewInstance(Nan::GetFunction(constructorHandle).ToLocalChecked()).ToLocalChecked());
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/node_snap7_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ NAN_MODULE_INIT(S7Server::Init) {
, v8::ReadOnly);

constructor.Reset(tpl);
Nan::Set(target, name, tpl->GetFunction());
Nan::Set(target, name, Nan::GetFunction(tpl).ToLocalChecked());
}

NAN_METHOD(S7Server::New) {
Expand All @@ -651,7 +651,7 @@ NAN_METHOD(S7Server::New) {
v8::Local<v8::FunctionTemplate> constructorHandle;
constructorHandle = Nan::New<v8::FunctionTemplate>(constructor);
info.GetReturnValue().Set(
Nan::NewInstance(constructorHandle->GetFunction()).ToLocalChecked());
Nan::NewInstance(Nan::GetFunction(constructorHandle).ToLocalChecked()).ToLocalChecked());
}
}

Expand Down

0 comments on commit a0cd99d

Please sign in to comment.