From a37b9c80ef837de5fc99d750c3597d32ad3814b0 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Mon, 15 Nov 2021 14:45:05 -0500 Subject: [PATCH] doc: document optional params in napi_get_cb_info MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michael Dawson PR-URL: https://github.com/nodejs/node/pull/40821 Reviewed-By: James M Snell Reviewed-By: Tobias Nießen Reviewed-By: Mohammed Keyvanzadeh Reviewed-By: Luigi Pinca --- doc/api/n-api.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 8356c00cd2e6aa..8fb73fa9d6ef24 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -4672,14 +4672,18 @@ napi_status napi_get_cb_info(napi_env env, * `[in] env`: The environment that the API is invoked under. * `[in] cbinfo`: The callback info passed into the callback function. * `[in-out] argc`: Specifies the length of the provided `argv` array and - receives the actual count of arguments. + receives the actual count of arguments. `argc` can + optionally be ignored by passing `NULL`. * `[out] argv`: Buffer to which the `napi_value` representing the arguments are copied. If there are more arguments than the provided count, only the requested number of arguments are copied. If there are fewer arguments provided than claimed, the rest of `argv` is filled with `napi_value` values - that represent `undefined`. -* `[out] this`: Receives the JavaScript `this` argument for the call. -* `[out] data`: Receives the data pointer for the callback. + that represent `undefined`. `argv` can optionally be ignored by + passing `NULL`. +* `[out] this`: Receives the JavaScript `this` argument for the call. `this` + can optionally be ignored by passing `NULL`. +* `[out] data`: Receives the data pointer for the callback. `data` can + optionally be ignored by passing `NULL`. Returns `napi_ok` if the API succeeded.