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

Method Function

napi-inl.deprecated.h:129–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127
128template <typename Callable>
129inline PropertyDescriptor PropertyDescriptor::Function(
130 const char* utf8name,
131 Callable cb,
132 napi_property_attributes attributes,
133 void* /*data*/) {
134 using ReturnType = decltype(cb(CallbackInfo(nullptr, nullptr)));
135 using CbData = details::CallbackData<Callable, ReturnType>;
136 // TODO: Delete when the function is destroyed
137 auto callbackData = new CbData({cb, nullptr});
138
139 return PropertyDescriptor({utf8name,
140 nullptr,
141 CbData::Wrapper,
142 nullptr,
143 nullptr,
144 nullptr,
145 attributes,
146 callbackData});
147}
148
149template <typename Callable>
150inline PropertyDescriptor PropertyDescriptor::Function(

Callers

nothing calls this directly

Calls 4

CallbackInfoClass · 0.85
PropertyDescriptorClass · 0.85
FunctionClass · 0.85
cbFunction · 0.50

Tested by

no test coverage detected