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

Method NAN_MODULE_INIT

test/cpp/wrappedobjectfactory.cpp:17–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15class InnerObject : public ObjectWrap {
16 public:
17 static NAN_MODULE_INIT(Init) {
18 v8::Local<v8::FunctionTemplate> tpl = Nan::New<v8::FunctionTemplate>(New);
19 tpl->InstanceTemplate()->SetInternalFieldCount(1);
20
21 SetPrototypeMethod(tpl, "getValue", GetValue);
22
23 constructor().Reset(GetFunction(tpl).ToLocalChecked());
24 }
25
26 static
27 v8::Local<v8::Object> NewInstance(int argc, v8::Local<v8::Value> argv[]) {

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