From c4ecd6886989a9c1289d073d2ba261bd24a38fe4 Mon Sep 17 00:00:00 2001 From: richerfu Date: Tue, 10 Dec 2024 11:01:49 +0800 Subject: [PATCH] fix: compiler error --- include/napi-inl.h | 4 ++-- package/CHANGELOG.md | 4 ++++ package/oh-package.json5 | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/napi-inl.h b/include/napi-inl.h index 2f72de7..0052788 100644 --- a/include/napi-inl.h +++ b/include/napi-inl.h @@ -2847,7 +2847,7 @@ inline void ArrayBuffer::Detach() { void *data = nullptr; size_t length = 0; napi_status status = napi_get_buffer_info(_env, _value, &data, &length); - NAPI_THROW_IF_FAILED(_env, status, Buffer()); + NAPI_THROW_IF_FAILED(_env, status, 0); return length; } @@ -2856,7 +2856,7 @@ inline void ArrayBuffer::Detach() { void *data = nullptr; size_t length = 0; napi_status status = napi_get_buffer_info(_env, _value, &data, &length); - NAPI_THROW_IF_FAILED(_env, status, Buffer()); + NAPI_THROW_IF_FAILED(_env, status, 0); return reinterpret_cast(data); } diff --git a/package/CHANGELOG.md b/package/CHANGELOG.md index 51a0983..9551615 100755 --- a/package/CHANGELOG.md +++ b/package/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.0.4 +- Fix compiler error + +--- # 0.0.3 - The length of a TypedArray should be divided by its element length. diff --git a/package/oh-package.json5 b/package/oh-package.json5 index ec2f32d..f352dc4 100755 --- a/package/oh-package.json5 +++ b/package/oh-package.json5 @@ -4,7 +4,7 @@ name: "@ohos-rs/node-addon-api", description: "Node-addon-api for OpenHarmony/HarmonyNext", main: "index.ets", - version: "0.0.3", + version: "0.0.4", types: "libs/index.d.ts", dependencies: {} } \ No newline at end of file