Skip to content

Commit

Permalink
doc: document optional params in napi_get_cb_info
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: #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>
  • Loading branch information
mhdawson authored and targos committed Nov 21, 2021
1 parent dfdf68f commit 4c47b01
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions doc/api/n-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4c47b01

Please sign in to comment.