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

Function PostFinalizerWithDataAndHint

test/finalizer_order.cc:111–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111Napi::Value PostFinalizerWithDataAndHint(const Napi::CallbackInfo& info) {
112 auto env = info.Env();
113
114 env.PostFinalizer(
115 [callback = Napi::Persistent(info[0].As<Napi::Function>())](
116 Napi::Env /*env*/,
117 Napi::Reference<Napi::Value>* data,
118 Napi::Reference<Napi::Value>* hint) {
119 callback.Call({data->Value(), hint->Value()});
120 delete data;
121 delete hint;
122 },
123 new Napi::Reference<Napi::Value>(Napi::Persistent(info[1])),
124 new Napi::Reference<Napi::Value>(Napi::Persistent(info[2])));
125
126 return env.Undefined();
127}
128#endif
129
130} // namespace

Callers

nothing calls this directly

Calls 5

PersistentFunction · 0.85
EnvMethod · 0.80
PostFinalizerMethod · 0.80
CallMethod · 0.80
ValueMethod · 0.80

Tested by

no test coverage detected