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

Function CallWithRecvArgc

test/function_reference.cc:83–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83Value CallWithRecvArgc(const CallbackInfo& info) {
84 EscapableHandleScope scope(info.Env());
85 FunctionReference ref;
86 ref.Reset(info[0].As<Function>());
87
88 size_t argLength = info.Length() > 2 ? info.Length() - 2 : 0;
89 std::unique_ptr<napi_value[]> args{argLength > 0 ? new napi_value[argLength]
90 : nullptr};
91 for (size_t i = 0; i < argLength; ++i) {
92 args[i] = info[i + 2];
93 }
94
95 return scope.Escape(MaybeUnwrap(ref.Call(info[1], argLength, args.get())));
96}
97
98Value MakeAsyncCallbackWithInitList(const Napi::CallbackInfo& info) {
99 Napi::FunctionReference ref;

Callers

nothing calls this directly

Calls 6

MaybeUnwrapFunction · 0.85
EnvMethod · 0.80
ResetMethod · 0.80
LengthMethod · 0.80
EscapeMethod · 0.80
CallMethod · 0.80

Tested by

no test coverage detected