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

Function MakeCallbackWithCStyleArray

test/function.cc:202–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202void MakeCallbackWithCStyleArray(const CallbackInfo& info) {
203 Env env = info.Env();
204 Function callback = info[0].As<Function>();
205 Object resource = info[1].As<Object>();
206
207 AsyncContext context(env, "function_test_context", resource);
208
209 std::vector<napi_value> args;
210 args.reserve(3);
211 args.push_back(info[2]);
212 args.push_back(info[3]);
213 args.push_back(info[4]);
214 callback.MakeCallback(resource, args.size(), args.data(), context);
215}
216
217void MakeCallbackWithInvalidReceiver(const CallbackInfo& info) {
218 Function callback = info[0].As<Function>();

Callers

nothing calls this directly

Calls 3

EnvMethod · 0.80
MakeCallbackMethod · 0.80
dataMethod · 0.80

Tested by

no test coverage detected