From a6b5722f1ce0837c73f1ce4d519dcb75ed644b6d Mon Sep 17 00:00:00 2001 From: legendecas Date: Mon, 24 May 2021 01:04:24 +0800 Subject: [PATCH] src: set default return value of Reference Ref/Unref to 0 --- napi-inl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/napi-inl.h b/napi-inl.h index 7e9dd726a..bcdbe6788 100644 --- a/napi-inl.h +++ b/napi-inl.h @@ -2583,7 +2583,7 @@ template inline uint32_t Reference::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; } @@ -2591,7 +2591,7 @@ template inline uint32_t Reference::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; }