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

Method ~ObjectWrap

napi-inl.h:4906–4917  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4904
4905template <typename T>
4906inline NAPI_NO_SANITIZE_VPTR ObjectWrap<T>::~ObjectWrap() {
4907 // If the JS object still exists at this point, remove the finalizer added
4908 // through `napi_wrap()`.
4909 if (!IsEmpty() && !_finalized) {
4910 Object object = Value();
4911 // It is not valid to call `napi_remove_wrap()` with an empty `object`.
4912 // This happens e.g. during garbage collection.
4913 if (!object.IsEmpty() && _construction_failed) {
4914 napi_remove_wrap(Env(), object, nullptr);
4915 }
4916 }
4917}
4918
4919// with RTTI turned on, modern compilers check to see if virtual function
4920// pointers are stripped of RTTI by void casts. this is intrinsic to how Unwrap

Callers

nothing calls this directly

Calls 4

IsEmptyFunction · 0.85
EnvClass · 0.85
IsEmptyMethod · 0.80
ValueFunction · 0.70

Tested by

no test coverage detected