Skip to content

Commit bd3ddd9

Browse files
committed
doc: document optional params in napi_get_cb_info
Signed-off-by: Michael Dawson <[email protected]>
1 parent 3d747f2 commit bd3ddd9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

doc/api/n-api.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4630,14 +4630,18 @@ napi_status napi_get_cb_info(napi_env env,
46304630
* `[in] env`: The environment that the API is invoked under.
46314631
* `[in] cbinfo`: The callback info passed into the callback function.
46324632
* `[in-out] argc`: Specifies the length of the provided `argv` array and
4633-
receives the actual count of arguments.
4633+
receives the actual count of arguments. `argc` can
4634+
optionally be ignored by passing `NULL`.
46344635
* `[out] argv`: Buffer to which the `napi_value` representing the arguments are
46354636
copied. If there are more arguments than the provided count, only the
46364637
requested number of arguments are copied. If there are fewer arguments
46374638
provided than claimed, the rest of `argv` is filled with `napi_value` values
4638-
that represent `undefined`.
4639-
* `[out] this`: Receives the JavaScript `this` argument for the call.
4640-
* `[out] data`: Receives the data pointer for the callback.
4639+
that represent `undefined`. `argv` can optionally be ignored by
4640+
passing `NULL`.
4641+
* `[out] this`: Receives the JavaScript `this` argument for the call. `this`
4642+
can optionally be ignored by passing `NULL`.
4643+
* `[out] data`: Receives the data pointer for the callback. `data` can
4644+
optionally be ignored by passing `NULL`.
46414645

46424646
Returns `napi_ok` if the API succeeded.
46434647

0 commit comments

Comments
 (0)