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

Function UnrefObjects

test/object_reference.cc:378–397  ·  view source on GitHub ↗

info[0] is a flag to determine if the weak, persistent, or multiple reference ObjectReference is being requested.

Source from the content-addressed store, hash-verified

376// info[0] is a flag to determine if the weak, persistent, or
377// multiple reference ObjectReference is being requested.
378Number UnrefObjects(const CallbackInfo& info) {
379 Env env = info.Env();
380 uint32_t num;
381
382 if (info[0] == String::New(env, "weak")) {
383 num = weak.Unref();
384 } else if (info[0] == String::New(env, "persistent")) {
385 num = persistent.Unref();
386 } else if (info[0] == String::New(env, "references")) {
387 num = reference.Unref();
388 } else if (info[0] == String::New(env, "casted weak")) {
389 num = casted_weak.Unref();
390 } else if (info[0] == String::New(env, "casted persistent")) {
391 num = casted_persistent.Unref();
392 } else {
393 num = casted_reference.Unref();
394 }
395
396 return Number::New(env, num);
397}
398
399// info[0] is a flag to determine if the weak, persistent, or
400// multiple reference ObjectReference is being requested.

Callers

nothing calls this directly

Calls 2

EnvMethod · 0.80
UnrefMethod · 0.80

Tested by

no test coverage detected