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: nodejs/node-addon-api#1004
Reviewed-By: Michael Dawson <midawson@redhat.com>
  • Loading branch information
kevindavies8 committed Jun 18, 2021
1 parent 5d39bf9 commit ba263c9
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 ba263c9

Please sign in to comment.