Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc/api
diff options
context:
space:
mode:
authorMichael Dawson <michael_dawson@ca.ibm.com>2020-04-08 23:17:37 +0300
committerMyles Borins <mylesborins@google.com>2020-04-17 20:43:41 +0300
commit1796cc0df5b43f2c5984db56422a5b103aadc578 (patch)
tree97500e7fc42605dfc3bda7e822337ce5ff483d0c /doc/api
parentf2c22db5806c9a9322a689bb07011a44fb0b9992 (diff)
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: https://github.com/nodejs/node/pull/32726 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Christopher Hiller <boneskull@boneskull.com>
Diffstat (limited to 'doc/api')
-rw-r--r--doc/api/n-api.md16
1 files changed, 8 insertions, 8 deletions
diff --git a/doc/api/n-api.md b/doc/api/n-api.md
index a38ebbd6f86..71796504b19 100644
--- a/doc/api/n-api.md
+++ b/doc/api/n-api.md
@@ -860,7 +860,7 @@ SemVer applying. In order to support this model with N-API, both
in internal functionality and for module specific functionality
(as its good practice), the `throw_` and `create_` functions
take an optional code parameter which is the string for the code
-to be added to the error object. If the optional parameter is NULL
+to be added to the error object. If the optional parameter is `NULL`
then no code will be associated with the error. If a code is provided,
the name associated with the error is also updated to be:
@@ -1058,7 +1058,7 @@ napi_status napi_get_and_clear_last_exception(napi_env env,
```
* `[in] env`: The environment that the API is invoked under.
-* `[out] result`: The exception if one is pending, NULL otherwise.
+* `[out] result`: The exception if one is pending, `NULL` otherwise.
Returns `napi_ok` if the API succeeded.
@@ -1350,7 +1350,7 @@ then be modified through [`napi_reference_ref`][] and
[`napi_reference_unref`][]. If an object is collected while the count
for a reference is 0, all subsequent calls to
get the object associated with the reference [`napi_get_reference_value`][]
-will return NULL for the returned `napi_value`. An attempt to call
+will return `NULL` for the returned `napi_value`. An attempt to call
[`napi_reference_ref`][] for a reference whose object has been collected
will result in an error.
@@ -1473,7 +1473,7 @@ Returns `napi_ok` if the API succeeded.
If still valid, this API returns the `napi_value` representing the
JavaScript `Object` associated with the `napi_ref`. Otherwise, result
-will be NULL.
+will be `NULL`.
### Cleanup on exit of the current Node.js instance
@@ -1549,7 +1549,7 @@ napi_value Init(napi_env env, napi_value exports);
The return value from `Init` is treated as the `exports` object for the module.
The `Init` method is passed an empty object via the `exports` parameter as a
-convenience. If `Init` returns NULL, the parameter passed as `exports` is
+convenience. If `Init` returns `NULL`, the parameter passed as `exports` is
exported by the module. N-API modules cannot modify the `module` object but can
specify anything as the `exports` property of the module.
@@ -2827,7 +2827,7 @@ napi_status napi_get_value_string_latin1(napi_env env,
* `[in] env`: The environment that the API is invoked under.
* `[in] value`: `napi_value` representing JavaScript string.
-* `[in] buf`: Buffer to write the ISO-8859-1-encoded string into. If NULL is
+* `[in] buf`: Buffer to write the ISO-8859-1-encoded string into. If `NULL` is
passed in, the length of the string (in bytes) is returned.
* `[in] bufsize`: Size of the destination buffer. When this value is
insufficient, the returned string will be truncated.
@@ -2856,7 +2856,7 @@ napi_status napi_get_value_string_utf8(napi_env env,
* `[in] env`: The environment that the API is invoked under.
* `[in] value`: `napi_value` representing JavaScript string.
-* `[in] buf`: Buffer to write the UTF8-encoded string into. If NULL is passed
+* `[in] buf`: Buffer to write the UTF8-encoded string into. If `NULL` is passed
in, the length of the string (in bytes) is returned.
* `[in] bufsize`: Size of the destination buffer. When this value is
insufficient, the returned string will be truncated.
@@ -2884,7 +2884,7 @@ napi_status napi_get_value_string_utf16(napi_env env,
* `[in] env`: The environment that the API is invoked under.
* `[in] value`: `napi_value` representing JavaScript string.
-* `[in] buf`: Buffer to write the UTF16-LE-encoded string into. If NULL is
+* `[in] buf`: Buffer to write the UTF16-LE-encoded string into. If `NULL` is
passed in, the length of the string (in 2-byte code units) is returned.
* `[in] bufsize`: Size of the destination buffer. When this value is
insufficient, the returned string will be truncated.