Skip to content

Commit 4c47b01

Browse files
mhdawsontargos
authored andcommitted
doc: document optional params in napi_get_cb_info
Signed-off-by: Michael Dawson <[email protected]> PR-URL: #40821 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent dfdf68f commit 4c47b01

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

doc/api/n-api.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -4672,14 +4672,18 @@ napi_status napi_get_cb_info(napi_env env,
46724672
* `[in] env`: The environment that the API is invoked under.
46734673
* `[in] cbinfo`: The callback info passed into the callback function.
46744674
* `[in-out] argc`: Specifies the length of the provided `argv` array and
4675-
receives the actual count of arguments.
4675+
receives the actual count of arguments. `argc` can
4676+
optionally be ignored by passing `NULL`.
46764677
* `[out] argv`: Buffer to which the `napi_value` representing the arguments are
46774678
copied. If there are more arguments than the provided count, only the
46784679
requested number of arguments are copied. If there are fewer arguments
46794680
provided than claimed, the rest of `argv` is filled with `napi_value` values
4680-
that represent `undefined`.
4681-
* `[out] this`: Receives the JavaScript `this` argument for the call.
4682-
* `[out] data`: Receives the data pointer for the callback.
4681+
that represent `undefined`. `argv` can optionally be ignored by
4682+
passing `NULL`.
4683+
* `[out] this`: Receives the JavaScript `this` argument for the call. `this`
4684+
can optionally be ignored by passing `NULL`.
4685+
* `[out] data`: Receives the data pointer for the callback. `data` can
4686+
optionally be ignored by passing `NULL`.
46834687
46844688
Returns `napi_ok` if the API succeeded.
46854689

0 commit comments

Comments
 (0)