From 4724e0747613caa3785a54ab9c719e91b88872ea Mon Sep 17 00:00:00 2001 From: Isaac Brodsky Date: Thu, 7 Oct 2021 17:59:56 -0700 Subject: [PATCH] doc: indicate n-api out params that may be NULL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: https://github.com/nodejs/node/pull/40371 Reviewed-By: Chengzhong Wu Reviewed-By: Tobias Nießen Reviewed-By: Michael Dawson Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- doc/api/n-api.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 5fb8cc65859ff1..f4025ffdbf37f7 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -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. @@ -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