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

Function GetCastedFromValue

test/object_reference.cc:341–355  ·  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

339// info[0] is a flag to determine if the weak, persistent, or
340// multiple reference ObjectReference is being requested.
341Value GetCastedFromValue(const CallbackInfo& info) {
342 Env env = info.Env();
343
344 if (info[0] == String::New(env, "weak")) {
345 if (casted_weak.IsEmpty()) {
346 return String::New(env, "No Referenced Value");
347 } else {
348 return casted_weak.Value();
349 }
350 } else if (info[0] == String::New(env, "persistent")) {
351 return casted_persistent.Value();
352 } else {
353 return casted_reference.Value();
354 }
355}
356
357// info[0] is a flag to determine if the weak, persistent, or
358// multiple reference ObjectReference is being requested.

Callers

nothing calls this directly

Calls 3

EnvMethod · 0.80
IsEmptyMethod · 0.80
ValueMethod · 0.80

Tested by

no test coverage detected