Skip to content

Commit 1796cc0

Browse files
mhdawsonMylesBorins
authored andcommitted
doc: improve consistency in usage of NULL
- add backticks around use of NULL - convert from null to NULL where we mean NULL Signed-off-by: Michael Dawson <[email protected]> PR-URL: #32726 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Christopher Hiller <[email protected]>
1 parent f2c22db commit 1796cc0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

doc/api/n-api.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ SemVer applying. In order to support this model with N-API, both
860860
in internal functionality and for module specific functionality
861861
(as its good practice), the `throw_` and `create_` functions
862862
take an optional code parameter which is the string for the code
863-
to be added to the error object. If the optional parameter is NULL
863+
to be added to the error object. If the optional parameter is `NULL`
864864
then no code will be associated with the error. If a code is provided,
865865
the name associated with the error is also updated to be:
866866

@@ -1058,7 +1058,7 @@ napi_status napi_get_and_clear_last_exception(napi_env env,
10581058
```
10591059

10601060
* `[in] env`: The environment that the API is invoked under.
1061-
* `[out] result`: The exception if one is pending, NULL otherwise.
1061+
* `[out] result`: The exception if one is pending, `NULL` otherwise.
10621062

10631063
Returns `napi_ok` if the API succeeded.
10641064

@@ -1350,7 +1350,7 @@ then be modified through [`napi_reference_ref`][] and
13501350
[`napi_reference_unref`][]. If an object is collected while the count
13511351
for a reference is 0, all subsequent calls to
13521352
get the object associated with the reference [`napi_get_reference_value`][]
1353-
will return NULL for the returned `napi_value`. An attempt to call
1353+
will return `NULL` for the returned `napi_value`. An attempt to call
13541354
[`napi_reference_ref`][] for a reference whose object has been collected
13551355
will result in an error.
13561356

@@ -1473,7 +1473,7 @@ Returns `napi_ok` if the API succeeded.
14731473

14741474
If still valid, this API returns the `napi_value` representing the
14751475
JavaScript `Object` associated with the `napi_ref`. Otherwise, result
1476-
will be NULL.
1476+
will be `NULL`.
14771477

14781478
### Cleanup on exit of the current Node.js instance
14791479

@@ -1549,7 +1549,7 @@ napi_value Init(napi_env env, napi_value exports);
15491549

15501550
The return value from `Init` is treated as the `exports` object for the module.
15511551
The `Init` method is passed an empty object via the `exports` parameter as a
1552-
convenience. If `Init` returns NULL, the parameter passed as `exports` is
1552+
convenience. If `Init` returns `NULL`, the parameter passed as `exports` is
15531553
exported by the module. N-API modules cannot modify the `module` object but can
15541554
specify anything as the `exports` property of the module.
15551555

@@ -2827,7 +2827,7 @@ napi_status napi_get_value_string_latin1(napi_env env,
28272827

28282828
* `[in] env`: The environment that the API is invoked under.
28292829
* `[in] value`: `napi_value` representing JavaScript string.
2830-
* `[in] buf`: Buffer to write the ISO-8859-1-encoded string into. If NULL is
2830+
* `[in] buf`: Buffer to write the ISO-8859-1-encoded string into. If `NULL` is
28312831
passed in, the length of the string (in bytes) is returned.
28322832
* `[in] bufsize`: Size of the destination buffer. When this value is
28332833
insufficient, the returned string will be truncated.
@@ -2856,7 +2856,7 @@ napi_status napi_get_value_string_utf8(napi_env env,
28562856

28572857
* `[in] env`: The environment that the API is invoked under.
28582858
* `[in] value`: `napi_value` representing JavaScript string.
2859-
* `[in] buf`: Buffer to write the UTF8-encoded string into. If NULL is passed
2859+
* `[in] buf`: Buffer to write the UTF8-encoded string into. If `NULL` is passed
28602860
in, the length of the string (in bytes) is returned.
28612861
* `[in] bufsize`: Size of the destination buffer. When this value is
28622862
insufficient, the returned string will be truncated.
@@ -2884,7 +2884,7 @@ napi_status napi_get_value_string_utf16(napi_env env,
28842884

28852885
* `[in] env`: The environment that the API is invoked under.
28862886
* `[in] value`: `napi_value` representing JavaScript string.
2887-
* `[in] buf`: Buffer to write the UTF16-LE-encoded string into. If NULL is
2887+
* `[in] buf`: Buffer to write the UTF16-LE-encoded string into. If `NULL` is
28882888
passed in, the length of the string (in 2-byte code units) is returned.
28892889
* `[in] bufsize`: Size of the destination buffer. When this value is
28902890
insufficient, the returned string will be truncated.

0 commit comments

Comments
 (0)