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

Function NAN_MODULE_INIT

test/cpp/indexedinterceptors.cpp:36–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36NAN_MODULE_INIT(IndexedInterceptor::Init) {
37 v8::Local<v8::FunctionTemplate> tpl =
38 Nan::New<v8::FunctionTemplate>(IndexedInterceptor::New);
39 indexedinterceptors_constructor.Reset(tpl);
40 tpl->SetClassName(Nan::New("IndexedInterceptor").ToLocalChecked());
41 tpl->InstanceTemplate()->SetInternalFieldCount(1);
42 v8::Local<v8::ObjectTemplate> inst = tpl->InstanceTemplate();
43
44 SetIndexedPropertyHandler(
45 inst
46 , IndexedInterceptor::PropertyGetter
47 , IndexedInterceptor::PropertySetter
48 , IndexedInterceptor::PropertyQuery
49 , IndexedInterceptor::PropertyDeleter
50 , IndexedInterceptor::PropertyEnumerator);
51
52 v8::Local<v8::Function> createnew =
53 Nan::GetFunction(Nan::New<v8::FunctionTemplate>(CreateNew))
54 .ToLocalChecked();
55 Set(target, Nan::New("create").ToLocalChecked(), createnew);
56}
57
58v8::Local<v8::Value> IndexedInterceptor::NewInstance () {
59 EscapableHandleScope scope;

Callers

nothing calls this directly

Calls 6

ToLocalCheckedMethod · 0.80
NewFunction · 0.50
GetFunctionFunction · 0.50
SetFunction · 0.50
ResetMethod · 0.45

Tested by

no test coverage detected