@@ -410,7 +410,7 @@ NODE_EXTERN napi_status napi_create_error(napi_env env,
410
410
napi_value* result);
411
411
```
412
412
- `[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
414
414
used as the message for the Error.
415
415
- `[out] result`: `napi_value` representing the error created.
416
416
@@ -428,7 +428,7 @@ NODE_EXTERN napi_status napi_create_type_error(napi_env env,
428
428
napi_value* result);
429
429
```
430
430
- ` [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
432
432
used as the message for the Error.
433
433
- ` [out] result ` : ` napi_value ` representing the error created.
434
434
@@ -447,7 +447,7 @@ NODE_EXTERN napi_status napi_create_range_error(napi_env env,
447
447
napi_value* result);
448
448
```
449
449
- `[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
451
451
used as the message for the Error.
452
452
- `[out] result`: `napi_value` representing the error created.
453
453
@@ -662,8 +662,8 @@ Object in the outer scope.
662
662
Returns `napi_ok` if the API succeeded.
663
663
664
664
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.
667
667
668
668
### References to objects with a lifespan longer than that of the native method
669
669
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,
1303
1303
1304
1304
- ` [in] env ` : The environment that the API is invoked under.
1305
1305
- ` [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.
1308
1308
- ` [out] result ` : A ` napi_value ` representing a JavaScript String.
1309
1309
1310
1310
Returns ` napi_ok ` if the API succeeded.
@@ -1328,7 +1328,7 @@ NAPI_EXTERN napi_status napi_create_string_latin1(napi_env env,
1328
1328
1329
1329
- `[in] env`: The environment that the API is invoked under.
1330
1330
- `[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
1332
1332
null-terminated.
1333
1333
- `[out] result`: A `napi_value` representing a JavaScript String.
1334
1334
@@ -1353,7 +1353,7 @@ napi_status napi_create_string_utf8(napi_env env,
1353
1353
1354
1354
- ` [in] env ` : The environment that the API is invoked under.
1355
1355
- ` [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
1357
1357
null-terminated.
1358
1358
- ` [out] result ` : A ` napi_value ` representing a JavaScript String.
1359
1359
0 commit comments