From 6b6e1d054e4ffb3074a6143bd5fc696be518f62f Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Mon, 29 Nov 2021 15:22:16 -0500 Subject: [PATCH] node-api,doc: document parms which can be optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: https://github.com/nodejs/abi-stable-node/issues/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 PR-URL: https://github.com/nodejs/node/pull/41021 Reviewed-By: Mohammed Keyvanzadeh Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Tobias Nießen --- doc/api/n-api.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 3a624934a94bdc..c146a6d661dddb 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -4735,7 +4735,8 @@ napi_status napi_new_instance(napi_env env, as a constructor. * `[in] argc`: The count of elements in the `argv` array. * `[in] argv`: Array of JavaScript values as `napi_value` representing the - arguments to the constructor. + arguments to the constructor. If `argc` is zero this parameter may be + omitted by passing in `NULL`. * `[out] result`: `napi_value` representing the JavaScript object returned, which in this case is the constructed object. @@ -5512,7 +5513,8 @@ NAPI_EXTERN napi_status napi_make_callback(napi_env env, * `[in] func`: `napi_value` representing the JavaScript function to be invoked. * `[in] argc`: The count of elements in the `argv` array. * `[in] argv`: Array of JavaScript values as `napi_value` representing the - arguments to the function. + arguments to the function. If `argc` is zero this parameter may be + omitted by passing in `NULL`. * `[out] result`: `napi_value` representing the JavaScript object returned. Returns `napi_ok` if the API succeeded.