Skip to content

Commit 622756b

Browse files
authored
Merge pull request #53 from alexandrudima/fix-node10-error
Fix node 10 compilation error
2 parents 277aeff + 8381778 commit 622756b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/NSFW.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,12 @@ NAN_MODULE_INIT(NSFW::Init) {
155155

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

0 commit comments

Comments
 (0)