Skip to content

Commit

Permalink
src: set default return value of Reference Ref/Unref to 0
Browse files Browse the repository at this point in the history
PR-URL: #1004
Reviewed-By: Michael Dawson <[email protected]>
  • Loading branch information
legendecas authored and mhdawson committed Jun 18, 2021
1 parent ad76ad0 commit 37a9b8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions napi-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2609,15 +2609,15 @@ template <typename T>
inline uint32_t Reference<T>::Ref() {
uint32_t result;
napi_status status = napi_reference_ref(_env, _ref, &result);
NAPI_THROW_IF_FAILED(_env, status, 1);
NAPI_THROW_IF_FAILED(_env, status, 0);
return result;
}

template <typename T>
inline uint32_t Reference<T>::Unref() {
uint32_t result;
napi_status status = napi_reference_unref(_env, _ref, &result);
NAPI_THROW_IF_FAILED(_env, status, 1);
NAPI_THROW_IF_FAILED(_env, status, 0);
return result;
}

Expand Down

0 comments on commit 37a9b8e

Please sign in to comment.