We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 277aeff + 8381778 commit 622756bCopy full SHA for 622756b
src/NSFW.cpp
@@ -155,8 +155,12 @@ NAN_MODULE_INIT(NSFW::Init) {
155
156
NAN_METHOD(NSFW::JSNew) {
157
if (!info.IsConstructCall()) {
158
- v8::Local<v8::Function> cons = New<v8::Function>(constructor);
159
- info.GetReturnValue().Set(cons->NewInstance());
+ const int argc = 4;
+ 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());
164
return;
165
}
166
0 commit comments