@@ -2391,7 +2391,8 @@ napi_status napi_get_arraybuffer_info(napi_env env,
2391
2391
2392
2392
* `[in] env`: The environment that the API is invoked under.
2393
2393
* `[in] arraybuffer`: `napi_value` representing the `ArrayBuffer` being queried.
2394
- * `[out] data`: The underlying data buffer of the `ArrayBuffer`.
2394
+ * `[out] data`: The underlying data buffer of the `ArrayBuffer`. If byte_length
2395
+ is `0`, this may be `NULL` or any other pointer value.
2395
2396
* `[out] byte_length`: Length in bytes of the underlying data buffer.
2396
2397
2397
2398
Returns `napi_ok` if the API succeeded.
@@ -2423,6 +2424,7 @@ napi_status napi_get_buffer_info(napi_env env,
2423
2424
* `[in] env`: The environment that the API is invoked under.
2424
2425
* `[in] value`: `napi_value` representing the `node::Buffer` being queried.
2425
2426
* `[out] data`: The underlying data buffer of the `node::Buffer`.
2427
+ If length is `0`, this may be `NULL` or any other pointer value.
2426
2428
* `[out] length`: Length in bytes of the underlying data buffer.
2427
2429
2428
2430
Returns `napi_ok` if the API succeeded.
@@ -2476,7 +2478,8 @@ napi_status napi_get_typedarray_info(napi_env env,
2476
2478
* `[out] length`: The number of elements in the `TypedArray`.
2477
2479
* `[out] data`: The data buffer underlying the `TypedArray` adjusted by
2478
2480
the `byte_offset` value so that it points to the first element in the
2479
- `TypedArray`.
2481
+ `TypedArray`. If the length of the array is `0`, this may be `NULL` or
2482
+ any other pointer value.
2480
2483
* `[out] arraybuffer`: The `ArrayBuffer` underlying the `TypedArray`.
2481
2484
* `[out] byte_offset`: The byte offset within the underlying native array
2482
2485
at which the first element of the arrays is located. The value for the data
@@ -2511,6 +2514,7 @@ napi_status napi_get_dataview_info(napi_env env,
2511
2514
properties to query.
2512
2515
* `[out] byte_length`: `Number` of bytes in the `DataView`.
2513
2516
* `[out] data`: The data buffer underlying the `DataView`.
2517
+ If byte_length is `0`, this may be `NULL` or any other pointer value.
2514
2518
* `[out] arraybuffer`: `ArrayBuffer` underlying the `DataView`.
2515
2519
* `[out] byte_offset`: The byte offset within the data buffer from which
2516
2520
to start projecting the `DataView`.
0 commit comments