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

Function GetFromValue

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

241// info[0] is a flag to determine if the weak, persistent, or
242// multiple reference ObjectReference is being requested.
243Value GetFromValue(const CallbackInfo& info) {
244 Env env = info.Env();
245
246 if (info[0] == String::New(env, "weak")) {
247 if (weak.IsEmpty()) {
248 return String::New(env, "No Referenced Value");
249 } else {
250 return weak.Value();
251 }
252 } else if (info[0] == String::New(env, "persistent")) {
253 return persistent.Value();
254 } else {
255 return reference.Value();
256 }
257}
258
259Value GetHelper(ObjectReference& ref,
260 Object& configObject,

Callers

nothing calls this directly

Calls 3

EnvMethod · 0.80
IsEmptyMethod · 0.80
ValueMethod · 0.80

Tested by

no test coverage detected