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

Function CreateFunction

napi-inl.h:2739–2751  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2737
2738template <typename CbData>
2739inline napi_status CreateFunction(napi_env env,
2740 const char* utf8name,
2741 napi_callback cb,
2742 CbData* data,
2743 napi_value* result) {
2744 napi_status status =
2745 napi_create_function(env, utf8name, NAPI_AUTO_LENGTH, cb, data, result);
2746 if (status == napi_ok) {
2747 status = Napi::details::AttachData(env, *result, data);
2748 }
2749
2750 return status;
2751}
2752
2753template <Function::VoidCallback cb>
2754inline Function Function::New(napi_env env, const char* utf8name, void* data) {

Callers 2

NewMethod · 0.85
DefineClassMethod · 0.85

Calls 1

AttachDataFunction · 0.85

Tested by

no test coverage detected