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

Function NAN_METHOD

test/cpp/settemplate.cpp:95–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95NAN_METHOD(MyObject::New) {
96 if (info.IsConstructCall()) {
97 MyObject* obj = new MyObject();
98 obj->Wrap(info.This());
99 info.GetReturnValue().Set(info.This());
100 } else {
101 v8::Local<v8::Function> cons = Nan::New<v8::Function>(constructor);
102 info.GetReturnValue().Set(Nan::NewInstance(cons).ToLocalChecked());
103 }
104}
105
106NODE_MODULE(settemplate, MyObject::Init)

Callers

nothing calls this directly

Calls 5

WrapMethod · 0.80
ToLocalCheckedMethod · 0.80
NewInstanceFunction · 0.50
SetMethod · 0.45
GetReturnValueMethod · 0.45

Tested by

no test coverage detected