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

Method ObjectWrap

napi-inl.h:4891–4903  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4889
4890template <typename T>
4891inline NAPI_NO_SANITIZE_VPTR ObjectWrap<T>::ObjectWrap(
4892 const Napi::CallbackInfo& callbackInfo) {
4893 napi_env env = callbackInfo.Env();
4894 napi_value wrapper = callbackInfo.This();
4895 napi_status status;
4896 napi_ref ref;
4897 T* instance = static_cast<T*>(this);
4898 status = napi_wrap(env, wrapper, instance, FinalizeCallback, nullptr, &ref);
4899 NAPI_THROW_IF_FAILED_VOID(env, status);
4900
4901 Reference<Object>* instanceRef = instance;
4902 *instanceRef = Reference<Object>(env, ref);
4903}
4904
4905template <typename T>
4906inline NAPI_NO_SANITIZE_VPTR ObjectWrap<T>::~ObjectWrap() {

Callers

nothing calls this directly

Calls 2

EnvMethod · 0.80
ThisMethod · 0.80

Tested by

no test coverage detected