diff --git a/src/NSFW.cpp b/src/NSFW.cpp index 09941aab..ea790875 100644 --- a/src/NSFW.cpp +++ b/src/NSFW.cpp @@ -155,8 +155,12 @@ NAN_MODULE_INIT(NSFW::Init) { NAN_METHOD(NSFW::JSNew) { if (!info.IsConstructCall()) { - v8::Local cons = New(constructor); - info.GetReturnValue().Set(cons->NewInstance()); + const int argc = 4; + v8::Isolate *isolate = info.GetIsolate(); + v8::Local argv[argc] = {info[0], info[1], info[2], info[3]}; + v8::Local context = isolate->GetCurrentContext(); + v8::Local cons = v8::Local::New(isolate, constructor); + info.GetReturnValue().Set(cons->NewInstance(context, argc, argv).ToLocalChecked()); return; }