MCPcopy Index your code
hub / github.com/nodejs/node-addon-api / MakeAsyncCallbackWithVector

Function MakeAsyncCallbackWithVector

test/function_reference.cc:108–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108Value MakeAsyncCallbackWithVector(const Napi::CallbackInfo& info) {
109 Napi::FunctionReference ref;
110 ref.Reset(info[0].As<Function>());
111 std::vector<napi_value> newVec;
112 Napi::AsyncContext context(info.Env(), "func_ref_resources", {});
113
114 for (int i = 1; i < (int)info.Length(); i++) {
115 newVec.push_back(info[i]);
116 }
117
118 return MaybeUnwrap(
119 ref.MakeCallback(Napi::Object::New(info.Env()), newVec, context));
120}
121
122Value MakeAsyncCallbackWithArgv(const Napi::CallbackInfo& info) {
123 Napi::FunctionReference ref;

Callers

nothing calls this directly

Calls 5

MaybeUnwrapFunction · 0.85
ResetMethod · 0.80
EnvMethod · 0.80
LengthMethod · 0.80
MakeCallbackMethod · 0.80

Tested by

no test coverage detected