Skip to content

Commit

Permalink
doc: indicate n-api out params that may be NULL
Browse files Browse the repository at this point in the history
This is useful information to have for applications that don't need to read the other properties. The implementation checks for `nullptr`, see: https://github.com/nodejs/node/blob/master/src/js_native_api_v8.cc#L2879

PR-URL: #40371
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
isaacbrodsky authored and targos committed Nov 4, 2021
1 parent e2c9e1c commit 4724e07
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc/api/n-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2821,6 +2821,8 @@ Returns `napi_ok` if the API succeeded.

This API returns various properties of a typed array.

Any of the out parameters may be `NULL` if that property is unneeded.

*Warning*: Use caution while using this API since the underlying data buffer
is managed by the VM.

Expand Down Expand Up @@ -2851,6 +2853,8 @@ napi_status napi_get_dataview_info(napi_env env,

Returns `napi_ok` if the API succeeded.

Any of the out parameters may be `NULL` if that property is unneeded.

This API returns various properties of a `DataView`.

#### napi_get_date_value
Expand Down

0 comments on commit 4724e07

Please sign in to comment.