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

Method NAN_MODULE_INIT

test/cpp/wrappedobjectfactory.cpp:66–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64class MyObject : public ObjectWrap {
65 public:
66 static NAN_MODULE_INIT(Init) {
67 v8::Local<v8::FunctionTemplate> tpl = Nan::New<v8::FunctionTemplate>(New);
68 tpl->InstanceTemplate()->SetInternalFieldCount(1);
69
70 SetPrototypeMethod(tpl, "getValue", GetValue);
71 SetPrototypeMethod(tpl, "newInnerObject", NewInnerObject);
72
73 constructor().Reset(GetFunction(tpl).ToLocalChecked());
74 }
75
76 static NAN_METHOD(NewInstance) {
77 v8::Local<v8::Function> cons = Nan::New(constructor());

Callers

nothing calls this directly

Calls 4

SetPrototypeMethodFunction · 0.85
ToLocalCheckedMethod · 0.80
GetFunctionFunction · 0.50
ResetMethod · 0.45

Tested by

no test coverage detected