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

Function MakeCallbackWithVector

test/function.cc:187–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187void MakeCallbackWithVector(const CallbackInfo& info) {
188 Env env = info.Env();
189 Function callback = info[0].As<Function>();
190 Object resource = info[1].As<Object>();
191
192 AsyncContext context(env, "function_test_context", resource);
193
194 std::vector<napi_value> args;
195 args.reserve(3);
196 args.push_back(info[2]);
197 args.push_back(info[3]);
198 args.push_back(info[4]);
199 callback.MakeCallback(resource, args, context);
200}
201
202void MakeCallbackWithCStyleArray(const CallbackInfo& info) {
203 Env env = info.Env();

Callers

nothing calls this directly

Calls 2

EnvMethod · 0.80
MakeCallbackMethod · 0.80

Tested by

no test coverage detected