File tree 4 files changed +15
-8
lines changed
4 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 1
1
# node-addon-api-ohos
2
2
3
- ![ Platform] ( https://img.shields.io/badge/platform-arm64/arm/x86__64-blue ) [ ![ License: MIT] ( https://img.shields.io/badge/License-MIT-yellow.svg )] ( https://opensource.org/licenses/MIT ) ![ Ohpm Version] ( https://img.shields.io/badge/OhpmVersion-0.0.1 -green )
3
+ ![ Platform] ( https://img.shields.io/badge/platform-arm64/arm/x86__64-blue ) [ ![ License: MIT] ( https://img.shields.io/badge/License-MIT-yellow.svg )] ( https://opensource.org/licenses/MIT ) ![ Ohpm Version] ( https://img.shields.io/badge/OhpmVersion-0.0.3 -green )
4
4
5
5
` node-addon-api ` for OpenHarmony/HarmonyNext.
6
6
@@ -31,11 +31,12 @@ target_link_libraries(entry PRIVATE node_addon_api_ohos)
31
31
32
32
For node-addon-api-ohos, we acccepted the following environment variables:
33
33
34
- | Name | Description | Default Value |
35
- | --------------------------- | ----------------------------------- | ------------- |
36
- | NAPI_CPP_EXCEPTIONS | Allow catch the cpp exception | true |
37
- | NAPI_DISABLE_CPP_EXCEPTIONS | Disable catch the cpp exception | false |
38
- | NAPI_NORMAL | Hidden some APIs or cases for Harmony | true |
34
+ | Name | Description | Default Value |
35
+ | --------------------------- | ----------------------------------------- | ------------- |
36
+ | NAPI_CPP_EXCEPTIONS | Allow catch the cpp exception | true |
37
+ | NAPI_DISABLE_CPP_EXCEPTIONS | Disable catch the cpp exception | false |
38
+ | NAPI_NORMAL | Hidden some APIs or cases for Harmony | true |
39
+ | NODE_GYP_MODULE_NAME | ` NODE_API_ADDON ` use it as library's name | |
39
40
40
41
## Build
41
42
Original file line number Diff line number Diff line change @@ -2219,15 +2219,17 @@ inline void ArrayBuffer::Detach() {
2219
2219
_type(napi_typedarray_type::napi_int8_array),
2220
2220
_length(0 ) {
2221
2221
if (value != nullptr ) {
2222
+ size_t len = 0 ;
2222
2223
napi_status status =
2223
2224
napi_get_typedarray_info (_env,
2224
2225
_value,
2225
2226
&const_cast <TypedArray*>(this )->_type ,
2226
- &const_cast <TypedArray*>( this )-> _length ,
2227
+ &len ,
2227
2228
nullptr ,
2228
2229
nullptr ,
2229
2230
nullptr );
2230
2231
NAPI_THROW_IF_FAILED_VOID (_env, status);
2232
+ _length = len / ElementSize ();
2231
2233
}
2232
2234
}
2233
2235
Original file line number Diff line number Diff line change
1
+ # 0.0.3
2
+ - The length of a TypedArray should be divided by its element length.
3
+
4
+ ---
1
5
# 0.0.2
2
6
- Buffer should extend Object directly.
3
7
Original file line number Diff line number Diff line change 4
4
name : "@ohos-rs/node-addon-api" ,
5
5
description : "Node-addon-api for OpenHarmony/HarmonyNext" ,
6
6
main : "index.ets" ,
7
- version : "0.0.2 " ,
7
+ version : "0.0.3 " ,
8
8
types : "libs/index.d.ts" ,
9
9
dependencies : { }
10
10
}
You can’t perform that action at this time.
0 commit comments