Skip to content

Commit

Permalink
fix: compiler error
Browse files Browse the repository at this point in the history
  • Loading branch information
richerfu committed Dec 10, 2024
1 parent 1deba98 commit c4ecd68
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions include/napi-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>());
NAPI_THROW_IF_FAILED(_env, status, 0);
return length;
}

Expand All @@ -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<T>());
NAPI_THROW_IF_FAILED(_env, status, 0);
return reinterpret_cast<T*>(data);
}

Expand Down
4 changes: 4 additions & 0 deletions package/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion package/oh-package.json5
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}
}

0 comments on commit c4ecd68

Please sign in to comment.