MCPcopy Index your code
hub / github.com/nodejs/node-addon-api / Init

Function Init

benchmark/property_descriptor.cc:57–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55#endif // NAPI_VERSION > 5
56
57static Napi::Object Init(Napi::Env env, Napi::Object exports) {
58 napi_status status;
59 napi_property_descriptor core_prop = {"core",
60 nullptr,
61 nullptr,
62 Getter_Core,
63 Setter_Core,
64 nullptr,
65 napi_enumerable,
66 nullptr};
67
68 status = napi_define_properties(env, exports, 1, &core_prop);
69 NAPI_THROW_IF_FAILED(env, status, Napi::Object());
70
71 exports.DefineProperty(Napi::PropertyDescriptor::Accessor(
72 env, exports, "cplusplus", Getter, Setter, napi_enumerable));
73
74 exports.DefineProperty(Napi::PropertyDescriptor::Accessor<Getter, Setter>(
75 "templated", napi_enumerable));
76
77#if NAPI_VERSION > 5
78 PropDescBenchmark::Init(env, exports);
79#endif // NAPI_VERSION > 5
80
81 return exports;
82}
83
84NODE_API_MODULE(NODE_GYP_MODULE_NAME, Init)

Callers

nothing calls this directly

Calls 2

ObjectClass · 0.85
DefinePropertyMethod · 0.80

Tested by

no test coverage detected