Skip to content

Commit 7980f6f

Browse files
mhdawsonBridgeAR
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 <michael_dawson@ca.ibm.com> PR-URL: #32726 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Christopher Hiller <boneskull@boneskull.com>
1 parent 832ea52 commit 7980f6f

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
@@ -861,7 +861,7 @@ SemVer applying. In order to support this model with N-API, both
861861
in internal functionality and for module specific functionality
862862
(as its good practice), the `throw_` and `create_` functions
863863
take an optional code parameter which is the string for the code
864-
to be added to the error object. If the optional parameter is NULL
864+
to be added to the error object. If the optional parameter is `NULL`
865865
then no code will be associated with the error. If a code is provided,
866866
the name associated with the error is also updated to be:
867867

@@ -1059,7 +1059,7 @@ napi_status napi_get_and_clear_last_exception(napi_env env,
10591059
```
10601060

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

10641064
Returns `napi_ok` if the API succeeded.
10651065

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

@@ -1474,7 +1474,7 @@ Returns `napi_ok` if the API succeeded.
14741474

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

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

@@ -1550,7 +1550,7 @@ napi_value Init(napi_env env, napi_value exports);
15501550

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

@@ -2828,7 +2828,7 @@ napi_status napi_get_value_string_latin1(napi_env env,
28282828

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

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

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

0 commit comments

Comments
 (0)