Skip to content

Commit 02a9e77

Browse files
committed
squash: address comments
1 parent 05bc598 commit 02a9e77

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
@@ -410,7 +410,7 @@ NODE_EXTERN napi_status napi_create_error(napi_env env,
410410
napi_value* result);
411411
```
412412
- `[in] env`: The environment that the API is invoked under.
413-
- `[in] msg`: napi_value that referneces a JavaScript String to be
413+
- `[in] msg`: napi_value that references a JavaScript String to be
414414
used as the message for the Error.
415415
- `[out] result`: `napi_value` representing the error created.
416416
@@ -428,7 +428,7 @@ NODE_EXTERN napi_status napi_create_type_error(napi_env env,
428428
napi_value* result);
429429
```
430430
- `[in] env`: The environment that the API is invoked under.
431-
- `[in] msg`: napi_value that referneces a JavaScript String to be
431+
- `[in] msg`: napi_value that references a JavaScript String to be
432432
used as the message for the Error.
433433
- `[out] result`: `napi_value` representing the error created.
434434

@@ -447,7 +447,7 @@ NODE_EXTERN napi_status napi_create_range_error(napi_env env,
447447
napi_value* result);
448448
```
449449
- `[in] env`: The environment that the API is invoked under.
450-
- `[in] msg`: napi_value that referneces a JavaScript String to be
450+
- `[in] msg`: napi_value that references a JavaScript String to be
451451
used as the message for the Error.
452452
- `[out] result`: `napi_value` representing the error created.
453453
@@ -662,8 +662,8 @@ Object in the outer scope.
662662
Returns `napi_ok` if the API succeeded.
663663
664664
This API promotes the handle to the JavaScript object so that it is valid
665-
for the lifetime of the outer scope. It can only be called once. If it
666-
is called more than once an error will be returned.
665+
for the lifetime of the outer scope. It can only be called once per scope.
666+
If it is called more than once an error will be returned.
667667
668668
### References to objects with a lifespan longer than that of the native method
669669
In some cases an addon will need to be able to create and reference objects
@@ -1303,8 +1303,8 @@ napi_status napi_create_string_utf16(napi_env env,
13031303

13041304
- `[in] env`: The environment that the API is invoked under.
13051305
- `[in] str`: Character buffer representing a UTF16-LE-encoded string.
1306-
- `[in] length`: The length of the string in characters, or -1 if it is
1307-
null-terminated.
1306+
- `[in] length`: The length of the string in two-byte code units, or -1 if
1307+
it is null-terminated.
13081308
- `[out] result`: A `napi_value` representing a JavaScript String.
13091309

13101310
Returns `napi_ok` if the API succeeded.
@@ -1328,7 +1328,7 @@ NAPI_EXTERN napi_status napi_create_string_latin1(napi_env env,
13281328
13291329
- `[in] env`: The environment that the API is invoked under.
13301330
- `[in] str`: Character buffer representing a latin1-encoded string.
1331-
- `[in] length`: The length of the string in characters, or -1 if it is
1331+
- `[in] length`: The length of the string in bytes, or -1 if it is
13321332
null-terminated.
13331333
- `[out] result`: A `napi_value` representing a JavaScript String.
13341334
@@ -1353,7 +1353,7 @@ napi_status napi_create_string_utf8(napi_env env,
13531353

13541354
- `[in] env`: The environment that the API is invoked under.
13551355
- `[in] str`: Character buffer representing a UTF8-encoded string.
1356-
- `[in] length`: The length of the string in characters, or -1 if it is
1356+
- `[in] length`: The length of the string in bytes, or -1 if it is
13571357
null-terminated.
13581358
- `[out] result`: A `napi_value` representing a JavaScript String.
13591359

0 commit comments

Comments
 (0)