| 3647 | |
| 3648 | template <typename T> |
| 3649 | inline Reference<T>::~Reference() { |
| 3650 | if (_ref != nullptr) { |
| 3651 | if (!_suppressDestruct) { |
| 3652 | // TODO(legendecas): napi_delete_reference should be invoked immediately. |
| 3653 | // Fix this when https://github.com/nodejs/node/pull/55620 lands. |
| 3654 | #ifdef NODE_API_EXPERIMENTAL_HAS_POST_FINALIZER |
| 3655 | Env().PostFinalizer( |
| 3656 | [](Napi::Env env, napi_ref ref) { napi_delete_reference(env, ref); }, |
| 3657 | _ref); |
| 3658 | #else |
| 3659 | napi_delete_reference(_env, _ref); |
| 3660 | #endif |
| 3661 | } |
| 3662 | |
| 3663 | _ref = nullptr; |
| 3664 | } |
| 3665 | } |
| 3666 | |
| 3667 | template <typename T> |
| 3668 | inline Reference<T>::Reference(Reference<T>&& other) |
nothing calls this directly
no test coverage detected