MCPcopy Create free account
hub / github.com/nodejs/nan / NAN_METHOD

Function NAN_METHOD

test/cpp/returnvalue.cpp:15–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13static Global<v8::Boolean> global;
14
15NAN_METHOD(ReturnAValue) {
16 const FunctionCallbackInfo<v8::Value> &cbinfo = info;
17 ReturnValue<v8::Value> ret = cbinfo.GetReturnValue();
18 if (cbinfo.Length() == 1) {
19 ret.Set(To<v8::String>(info[0]).ToLocalChecked());
20 } else {
21 ret.Set(New("default").ToLocalChecked());
22 }
23}
24
25NAN_METHOD(ReturnPrimitive) {
26 info.GetReturnValue().Set(true);

Callers

nothing calls this directly

Calls 5

ToLocalCheckedMethod · 0.80
NewFunction · 0.50
GetReturnValueMethod · 0.45
SetMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected