doc: document optional params in napi_get_cb_info

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: https://github.com/nodejs/node/pull/40821
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Michael Dawson authored and Danielle Adams committed 2022-01-31 22:53:57 -05:00
1 parent 38f02dc4c1
commit 019b25fa5d
1 file changed
+8 -4
+8 -4
View File
@@ -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.