Skip to content

Commit 010173a

Browse files
TrottMylesBorins
authored andcommitted
doc: edit n-api.md for minor improvements
Not a comprehensive edit. Just a few things I noticed. * Favor present tense where there's a choice * Added a comma for clarity * Added a missing word ("in") PR-URL: #35361 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 0f4ecaa commit 010173a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

doc/api/n-api.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,11 +1526,11 @@ for a reference is 0, all subsequent calls to
15261526
get the object associated with the reference [`napi_get_reference_value`][]
15271527
will return `NULL` for the returned `napi_value`. An attempt to call
15281528
[`napi_reference_ref`][] for a reference whose object has been collected
1529-
will result in an error.
1529+
results in an error.
15301530

15311531
References must be deleted once they are no longer required by the addon. When
1532-
a reference is deleted it will no longer prevent the corresponding object from
1533-
being collected. Failure to delete a persistent reference will result in
1532+
a reference is deleted, it will no longer prevent the corresponding object from
1533+
being collected. Failure to delete a persistent reference results in
15341534
a 'memory leak' with both the native memory for the persistent reference and
15351535
the corresponding object on the heap being retained forever.
15361536

@@ -3089,7 +3089,7 @@ napi_status napi_get_value_string_latin1(napi_env env,
30893089
passed in, the length of the string in bytes and excluding the null terminator
30903090
is returned in `result`.
30913091
* `[in] bufsize`: Size of the destination buffer. When this value is
3092-
insufficient, the returned string will be truncated and null-terminated.
3092+
insufficient, the returned string is truncated and null-terminated.
30933093
* `[out] result`: Number of bytes copied into the buffer, excluding the null
30943094
terminator.
30953095

@@ -3119,7 +3119,7 @@ napi_status napi_get_value_string_utf8(napi_env env,
31193119
in, the length of the string in bytes and excluding the null terminator is
31203120
returned in `result`.
31213121
* `[in] bufsize`: Size of the destination buffer. When this value is
3122-
insufficient, the returned string will be truncated and null-terminated.
3122+
insufficient, the returned string is truncated and null-terminated.
31233123
* `[out] result`: Number of bytes copied into the buffer, excluding the null
31243124
terminator.
31253125

@@ -3148,7 +3148,7 @@ napi_status napi_get_value_string_utf16(napi_env env,
31483148
passed in, the length of the string in 2-byte code units and excluding the
31493149
null terminator is returned.
31503150
* `[in] bufsize`: Size of the destination buffer. When this value is
3151-
insufficient, the returned string will be truncated and null-terminated.
3151+
insufficient, the returned string is truncated and null-terminated.
31523152
* `[out] result`: Number of 2-byte code units copied into the buffer, excluding
31533153
the null terminator.
31543154

@@ -5137,8 +5137,8 @@ napi_status napi_async_init(napi_env env,
51375137
* `[in] async_resource`: Object associated with the async work
51385138
that will be passed to possible `async_hooks` [`init` hooks][].
51395139
In order to retain ABI compatibility with previous versions,
5140-
passing `NULL` for `async_resource` will not result in an error, however,
5141-
this will result incorrect operation of async hooks for the
5140+
passing `NULL` for `async_resource` does not result in an error. However,
5141+
this results in incorrect operation of async hooks for the
51425142
napi_async_context created. Potential issues include
51435143
loss of async context when using the AsyncLocalStorage API.
51445144
* `[in] async_resource_name`: Identifier for the kind of resource
@@ -5190,7 +5190,7 @@ NAPI_EXTERN napi_status napi_make_callback(napi_env env,
51905190
invoking the callback. This should normally be a value previously
51915191
obtained from [`napi_async_init`][].
51925192
In order to retain ABI compatibility with previous versions, passing `NULL`
5193-
for `async_context` will not result in an error. However, this will result
5193+
for `async_context` does not result in an error. However, this results
51945194
in incorrect operation of async hooks. Potential issues include loss of
51955195
async context when using the `AsyncLocalStorage` API.
51965196
* `[in] recv`: The `this` object passed to the called function.

0 commit comments

Comments
 (0)