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

Function NAN_MODULE_INIT

test/cpp/accessors2.cpp:44–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44NAN_MODULE_INIT(SetterGetter::Init) {
45 v8::Local<v8::FunctionTemplate> tpl =
46 Nan::New<v8::FunctionTemplate>(SetterGetter::New);
47 settergetter_constructor.Reset(tpl);
48 tpl->SetClassName(Nan::New<v8::String>("SetterGetter").ToLocalChecked());
49 tpl->InstanceTemplate()->SetInternalFieldCount(1);
50 SetPrototypeMethod(tpl, "log", SetterGetter::Log);
51 v8::Local<v8::Function> createnew =
52 Nan::GetFunction(Nan::New<v8::FunctionTemplate>(CreateNew))
53 .ToLocalChecked();
54 Set(target, Nan::New<v8::String>("create").ToLocalChecked(), createnew);
55}
56
57v8::Local<v8::Value> SetterGetter::NewInstance () {
58 EscapableHandleScope scope;

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected