diff options
author | Michael Dawson <michael_dawson@ca.ibm.com> | 2020-04-02 00:23:32 +0300 |
---|---|---|
committer | Beth Griggs <Bethany.Griggs@uk.ibm.com> | 2020-04-14 13:03:31 +0300 |
commit | 1a782e80e3581da192c3daa48f7a3433b79db51e (patch) | |
tree | 582143937419753b401012f1216dd98aacf679e4 /doc/api | |
parent | fee8cb1c428ad7fd883f6a1d76ae8eeb41a33171 (diff) |
doc: clarify behavior of napi_get_typedarray_info
Signed-off-by: Michael Dawson <michael_dawson@ca.ibm.com>
Fixes: https://github.com/nodejs/node/issues/32089
PR-URL: https://github.com/nodejs/node/pull/32603
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'doc/api')
-rw-r--r-- | doc/api/n-api.md | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 6989bcdeab6..a38ebbd6f86 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -2447,7 +2447,8 @@ napi_status napi_get_arraybuffer_info(napi_env env, * `[in] env`: The environment that the API is invoked under. * `[in] arraybuffer`: `napi_value` representing the `ArrayBuffer` being queried. -* `[out] data`: The underlying data buffer of the `ArrayBuffer`. +* `[out] data`: The underlying data buffer of the `ArrayBuffer`. If byte_length + is `0`, this may be `NULL` or any other pointer value. * `[out] byte_length`: Length in bytes of the underlying data buffer. Returns `napi_ok` if the API succeeded. @@ -2479,6 +2480,7 @@ napi_status napi_get_buffer_info(napi_env env, * `[in] env`: The environment that the API is invoked under. * `[in] value`: `napi_value` representing the `node::Buffer` being queried. * `[out] data`: The underlying data buffer of the `node::Buffer`. + If length is `0`, this may be `NULL` or any other pointer value. * `[out] length`: Length in bytes of the underlying data buffer. Returns `napi_ok` if the API succeeded. @@ -2532,7 +2534,8 @@ napi_status napi_get_typedarray_info(napi_env env, * `[out] length`: The number of elements in the `TypedArray`. * `[out] data`: The data buffer underlying the `TypedArray` adjusted by the `byte_offset` value so that it points to the first element in the - `TypedArray`. + `TypedArray`. If the length of the array is `0`, this may be `NULL` or + any other pointer value. * `[out] arraybuffer`: The `ArrayBuffer` underlying the `TypedArray`. * `[out] byte_offset`: The byte offset within the underlying native array at which the first element of the arrays is located. The value for the data @@ -2567,6 +2570,7 @@ napi_status napi_get_dataview_info(napi_env env, properties to query. * `[out] byte_length`: `Number` of bytes in the `DataView`. * `[out] data`: The data buffer underlying the `DataView`. + If byte_length is `0`, this may be `NULL` or any other pointer value. * `[out] arraybuffer`: `ArrayBuffer` underlying the `DataView`. * `[out] byte_offset`: The byte offset within the data buffer from which to start projecting the `DataView`. |