Skip to content

Commit

Permalink
Merge pull request #53 from alexandrudima/fix-node10-error
Browse files Browse the repository at this point in the history
Fix node 10 compilation error
  • Loading branch information
implausible authored Sep 22, 2018
2 parents 277aeff + 8381778 commit 622756b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/NSFW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,12 @@ NAN_MODULE_INIT(NSFW::Init) {

NAN_METHOD(NSFW::JSNew) {
if (!info.IsConstructCall()) {
v8::Local<v8::Function> cons = New<v8::Function>(constructor);
info.GetReturnValue().Set(cons->NewInstance());
const int argc = 4;
v8::Isolate *isolate = info.GetIsolate();
v8::Local<v8::Value> argv[argc] = {info[0], info[1], info[2], info[3]};
v8::Local<v8::Context> context = isolate->GetCurrentContext();
v8::Local<v8::Function> cons = v8::Local<v8::Function>::New(isolate, constructor);
info.GetReturnValue().Set(cons->NewInstance(context, argc, argv).ToLocalChecked());
return;
}

Expand Down

0 comments on commit 622756b

Please sign in to comment.