Upgrade nan for node 19.x support (#853)

This commit is contained in:
Michael Nutt
2023-02-24 02:30:01 +09:00
committed by GitHub
parent b287e18eff
commit 9212dad121
4 changed files with 17 additions and 2 deletions

View File

@@ -116,7 +116,11 @@ ParseError)JS").ToLocalChecked()).ToLocalChecked();
Nan::SetPrototypeMethod(tpl, "dumpDebugLogs", DumpDebugLogs);
Nan::SetPrototypeMethod(tpl, "queryRenderedFeatures", QueryRenderedFeatures);
#if defined NODE_MODULE_VERSION && NODE_MODULE_VERSION < 93
v8::Local<v8::Context> context = target->CreationContext();
#else
v8::Local<v8::Context> context = target->GetCreationContext().ToLocalChecked();
#endif
constructor.Reset(tpl->GetFunction(context).ToLocalChecked());
Nan::Set(target, Nan::New("Map").ToLocalChecked(), tpl->GetFunction(context).ToLocalChecked());