Skip to content

Commit 6b6e1d0

Browse files
mhdawsondanielleadams
authored andcommitted
node-api,doc: document parms which can be optional
Fixes: nodejs/abi-stable-node#252 I've been through the Node-api methods and I believe this is the last places where optional parameters were not documented. Signed-off-by: Michael Dawson <[email protected]> PR-URL: #41021 Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
1 parent fb8f2e9 commit 6b6e1d0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

doc/api/n-api.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -4735,7 +4735,8 @@ napi_status napi_new_instance(napi_env env,
47354735
as a constructor.
47364736
* `[in] argc`: The count of elements in the `argv` array.
47374737
* `[in] argv`: Array of JavaScript values as `napi_value` representing the
4738-
arguments to the constructor.
4738+
arguments to the constructor. If `argc` is zero this parameter may be
4739+
omitted by passing in `NULL`.
47394740
* `[out] result`: `napi_value` representing the JavaScript object returned,
47404741
which in this case is the constructed object.
47414742
@@ -5512,7 +5513,8 @@ NAPI_EXTERN napi_status napi_make_callback(napi_env env,
55125513
* `[in] func`: `napi_value` representing the JavaScript function to be invoked.
55135514
* `[in] argc`: The count of elements in the `argv` array.
55145515
* `[in] argv`: Array of JavaScript values as `napi_value` representing the
5515-
arguments to the function.
5516+
arguments to the function. If `argc` is zero this parameter may be
5517+
omitted by passing in `NULL`.
55165518
* `[out] result`: `napi_value` representing the JavaScript object returned.
55175519
55185520
Returns `napi_ok` if the API succeeded.

0 commit comments

Comments
 (0)