@@ -999,7 +999,7 @@ clear the exception. On success, result will contain the handle to
999
999
the last JavaScript `Object` thrown. If it is determined, after
1000
1000
retrieving the exception, the exception cannot be handled after all
1001
1001
it can be re-thrown it with [`napi_throw`][] where error is the
1002
- JavaScript `Error` object to be thrown.
1002
+ JavaScript value to be thrown.
1003
1003
1004
1004
The following utility functions are also available in case native code
1005
1005
needs to throw an exception or determine if a `napi_value` is an instance
@@ -1152,7 +1152,7 @@ NAPI_EXTERN napi_status napi_create_error(napi_env env,
1152
1152
* `[in] env`: The environment that the API is invoked under.
1153
1153
* `[in] code`: Optional `napi_value` with the string for the error code to be
1154
1154
associated with the error.
1155
- * `[in] msg`: `napi_value` that references a JavaScript `String ` to be used as
1155
+ * `[in] msg`: `napi_value` that references a JavaScript `string ` to be used as
1156
1156
the message for the `Error`.
1157
1157
* `[out] result`: `napi_value` representing the error created.
1158
1158
@@ -1176,7 +1176,7 @@ NAPI_EXTERN napi_status napi_create_type_error(napi_env env,
1176
1176
* `[in] env`: The environment that the API is invoked under.
1177
1177
* `[in] code`: Optional `napi_value` with the string for the error code to be
1178
1178
associated with the error.
1179
- * `[in] msg`: `napi_value` that references a JavaScript `String ` to be used as
1179
+ * `[in] msg`: `napi_value` that references a JavaScript `string ` to be used as
1180
1180
the message for the `Error`.
1181
1181
* `[out] result`: `napi_value` representing the error created.
1182
1182
@@ -1200,7 +1200,7 @@ NAPI_EXTERN napi_status napi_create_range_error(napi_env env,
1200
1200
* `[in] env`: The environment that the API is invoked under.
1201
1201
* `[in] code`: Optional `napi_value` with the string for the error code to be
1202
1202
associated with the error.
1203
- * `[in] msg`: `napi_value` that references a JavaScript `String ` to be used as
1203
+ * `[in] msg`: `napi_value` that references a JavaScript `string ` to be used as
1204
1204
the message for the `Error`.
1205
1205
* `[out] result`: `napi_value` representing the error created.
1206
1206
@@ -2322,14 +2322,14 @@ napi_status napi_create_symbol(napi_env env,
2322
2322
2323
2323
* `[in] env`: The environment that the API is invoked under.
2324
2324
* `[in] description`: Optional `napi_value` which refers to a JavaScript
2325
- `String ` to be set as the description for the symbol.
2326
- * `[out] result`: A `napi_value` representing a JavaScript `Symbol `.
2325
+ `string ` to be set as the description for the symbol.
2326
+ * `[out] result`: A `napi_value` representing a JavaScript `symbol `.
2327
2327
2328
2328
Returns `napi_ok` if the API succeeded.
2329
2329
2330
- This API creates a JavaScript `Symbol` object from a UTF8-encoded C string.
2330
+ This API creates a JavaScript `symbol` value from a UTF8-encoded C string.
2331
2331
2332
- The JavaScript `Symbol ` type is described in [Section 19.4][]
2332
+ The JavaScript `symbol ` type is described in [Section 19.4][]
2333
2333
of the ECMAScript Language Specification.
2334
2334
2335
2335
#### napi_create_typedarray
@@ -2416,14 +2416,14 @@ napi_status napi_create_int32(napi_env env, int32_t value, napi_value* result)
2416
2416
2417
2417
* `[in] env`: The environment that the API is invoked under.
2418
2418
* `[in] value`: Integer value to be represented in JavaScript.
2419
- * `[out] result`: A `napi_value` representing a JavaScript `Number `.
2419
+ * `[out] result`: A `napi_value` representing a JavaScript `number `.
2420
2420
2421
2421
Returns `napi_ok` if the API succeeded.
2422
2422
2423
2423
This API is used to convert from the C `int32_t` type to the JavaScript
2424
- `Number ` type.
2424
+ `number ` type.
2425
2425
2426
- The JavaScript `Number ` type is described in
2426
+ The JavaScript `number ` type is described in
2427
2427
[Section 6.1.6][] of the ECMAScript Language Specification.
2428
2428
2429
2429
#### napi_create_uint32
@@ -2438,14 +2438,14 @@ napi_status napi_create_uint32(napi_env env, uint32_t value, napi_value* result)
2438
2438
2439
2439
* `[in] env`: The environment that the API is invoked under.
2440
2440
* `[in] value`: Unsigned integer value to be represented in JavaScript.
2441
- * `[out] result`: A `napi_value` representing a JavaScript `Number `.
2441
+ * `[out] result`: A `napi_value` representing a JavaScript `number `.
2442
2442
2443
2443
Returns `napi_ok` if the API succeeded.
2444
2444
2445
2445
This API is used to convert from the C `uint32_t` type to the JavaScript
2446
- `Number ` type.
2446
+ `number ` type.
2447
2447
2448
- The JavaScript `Number ` type is described in
2448
+ The JavaScript `number ` type is described in
2449
2449
[Section 6.1.6][] of the ECMAScript Language Specification.
2450
2450
2451
2451
#### napi_create_int64
@@ -2460,14 +2460,14 @@ napi_status napi_create_int64(napi_env env, int64_t value, napi_value* result)
2460
2460
2461
2461
* `[in] env`: The environment that the API is invoked under.
2462
2462
* `[in] value`: Integer value to be represented in JavaScript.
2463
- * `[out] result`: A `napi_value` representing a JavaScript `Number `.
2463
+ * `[out] result`: A `napi_value` representing a JavaScript `number `.
2464
2464
2465
2465
Returns `napi_ok` if the API succeeded.
2466
2466
2467
2467
This API is used to convert from the C `int64_t` type to the JavaScript
2468
- `Number ` type.
2468
+ `number ` type.
2469
2469
2470
- The JavaScript `Number ` type is described in [Section 6.1.6][]
2470
+ The JavaScript `number ` type is described in [Section 6.1.6][]
2471
2471
of the ECMAScript Language Specification. Note the complete range of `int64_t`
2472
2472
cannot be represented with full precision in JavaScript. Integer values
2473
2473
outside the range of [`Number.MIN_SAFE_INTEGER`][] `-(2**53 - 1)` -
@@ -2485,14 +2485,14 @@ napi_status napi_create_double(napi_env env, double value, napi_value* result)
2485
2485
2486
2486
* `[in] env`: The environment that the API is invoked under.
2487
2487
* `[in] value`: Double-precision value to be represented in JavaScript.
2488
- * `[out] result`: A `napi_value` representing a JavaScript `Number `.
2488
+ * `[out] result`: A `napi_value` representing a JavaScript `number `.
2489
2489
2490
2490
Returns `napi_ok` if the API succeeded.
2491
2491
2492
2492
This API is used to convert from the C `double` type to the JavaScript
2493
- `Number ` type.
2493
+ `number ` type.
2494
2494
2495
- The JavaScript `Number ` type is described in
2495
+ The JavaScript `number ` type is described in
2496
2496
[Section 6.1.6][] of the ECMAScript Language Specification.
2497
2497
2498
2498
#### napi_create_bigint_int64
@@ -2581,14 +2581,14 @@ napi_status napi_create_string_latin1(napi_env env,
2581
2581
* `[in] str`: Character buffer representing an ISO-8859-1-encoded string.
2582
2582
* `[in] length`: The length of the string in bytes, or `NAPI_AUTO_LENGTH` if it
2583
2583
is null-terminated.
2584
- * `[out] result`: A `napi_value` representing a JavaScript `String `.
2584
+ * `[out] result`: A `napi_value` representing a JavaScript `string `.
2585
2585
2586
2586
Returns `napi_ok` if the API succeeded.
2587
2587
2588
- This API creates a JavaScript `String` object from an ISO-8859-1-encoded C
2588
+ This API creates a JavaScript `string` value from an ISO-8859-1-encoded C
2589
2589
string. The native string is copied.
2590
2590
2591
- The JavaScript `String ` type is described in
2591
+ The JavaScript `string ` type is described in
2592
2592
[Section 6.1.4][] of the ECMAScript Language Specification.
2593
2593
2594
2594
#### napi_create_string_utf16
@@ -2608,14 +2608,14 @@ napi_status napi_create_string_utf16(napi_env env,
2608
2608
* `[in] str`: Character buffer representing a UTF16-LE-encoded string.
2609
2609
* `[in] length`: The length of the string in two-byte code units, or
2610
2610
`NAPI_AUTO_LENGTH` if it is null-terminated.
2611
- * `[out] result`: A `napi_value` representing a JavaScript `String `.
2611
+ * `[out] result`: A `napi_value` representing a JavaScript `string `.
2612
2612
2613
2613
Returns `napi_ok` if the API succeeded.
2614
2614
2615
- This API creates a JavaScript `String` object from a UTF16-LE-encoded C string.
2615
+ This API creates a JavaScript `string` value from a UTF16-LE-encoded C string.
2616
2616
The native string is copied.
2617
2617
2618
- The JavaScript `String ` type is described in
2618
+ The JavaScript `string ` type is described in
2619
2619
[Section 6.1.4][] of the ECMAScript Language Specification.
2620
2620
2621
2621
#### napi_create_string_utf8
@@ -2635,14 +2635,14 @@ napi_status napi_create_string_utf8(napi_env env,
2635
2635
* `[in] str`: Character buffer representing a UTF8-encoded string.
2636
2636
* `[in] length`: The length of the string in bytes, or `NAPI_AUTO_LENGTH` if it
2637
2637
is null-terminated.
2638
- * `[out] result`: A `napi_value` representing a JavaScript `String `.
2638
+ * `[out] result`: A `napi_value` representing a JavaScript `string `.
2639
2639
2640
2640
Returns `napi_ok` if the API succeeded.
2641
2641
2642
- This API creates a JavaScript `String` object from a UTF8-encoded C string.
2642
+ This API creates a JavaScript `string` value from a UTF8-encoded C string.
2643
2643
The native string is copied.
2644
2644
2645
- The JavaScript `String ` type is described in
2645
+ The JavaScript `string ` type is described in
2646
2646
[Section 6.1.4][] of the ECMAScript Language Specification.
2647
2647
2648
2648
### Functions to convert from Node-API to C types
@@ -2806,7 +2806,7 @@ napi_status napi_get_dataview_info(napi_env env,
2806
2806
* `[in] env`: The environment that the API is invoked under.
2807
2807
* `[in] dataview`: `napi_value` representing the `DataView` whose
2808
2808
properties to query.
2809
- * `[out] byte_length`: ` Number` of bytes in the `DataView`.
2809
+ * `[out] byte_length`: Number of bytes in the `DataView`.
2810
2810
* `[out] data`: The data buffer underlying the `DataView`.
2811
2811
If byte_length is `0`, this may be `NULL` or any other pointer value.
2812
2812
* `[out] arraybuffer`: `ArrayBuffer` underlying the `DataView`.
@@ -2879,15 +2879,15 @@ napi_status napi_get_value_double(napi_env env,
2879
2879
```
2880
2880
2881
2881
* `[in] env`: The environment that the API is invoked under.
2882
- * `[in] value`: `napi_value` representing JavaScript `Number `.
2882
+ * `[in] value`: `napi_value` representing JavaScript `number `.
2883
2883
* `[out] result`: C double primitive equivalent of the given JavaScript
2884
- `Number `.
2884
+ `number `.
2885
2885
2886
2886
Returns `napi_ok` if the API succeeded. If a non-number `napi_value` is passed
2887
2887
in it returns `napi_number_expected`.
2888
2888
2889
2889
This API returns the C double primitive equivalent of the given JavaScript
2890
- `Number `.
2890
+ `number `.
2891
2891
2892
2892
#### napi_get_value_bigint_int64
2893
2893
<!-- YAML
@@ -3005,15 +3005,15 @@ napi_status napi_get_value_int32(napi_env env,
3005
3005
```
3006
3006
3007
3007
* `[in] env`: The environment that the API is invoked under.
3008
- * `[in] value`: `napi_value` representing JavaScript `Number `.
3008
+ * `[in] value`: `napi_value` representing JavaScript `number `.
3009
3009
* `[out] result`: C `int32` primitive equivalent of the given JavaScript
3010
- `Number `.
3010
+ `number `.
3011
3011
3012
3012
Returns `napi_ok` if the API succeeded. If a non-number `napi_value`
3013
3013
is passed in `napi_number_expected`.
3014
3014
3015
3015
This API returns the C `int32` primitive equivalent
3016
- of the given JavaScript `Number `.
3016
+ of the given JavaScript `number `.
3017
3017
3018
3018
If the number exceeds the range of the 32 bit integer, then the result is
3019
3019
truncated to the equivalent of the bottom 32 bits. This can result in a large
@@ -3035,17 +3035,17 @@ napi_status napi_get_value_int64(napi_env env,
3035
3035
```
3036
3036
3037
3037
* `[in] env`: The environment that the API is invoked under.
3038
- * `[in] value`: `napi_value` representing JavaScript `Number `.
3038
+ * `[in] value`: `napi_value` representing JavaScript `number `.
3039
3039
* `[out] result`: C `int64` primitive equivalent of the given JavaScript
3040
- `Number `.
3040
+ `number `.
3041
3041
3042
3042
Returns `napi_ok` if the API succeeded. If a non-number `napi_value`
3043
3043
is passed in it returns `napi_number_expected`.
3044
3044
3045
3045
This API returns the C `int64` primitive equivalent of the given JavaScript
3046
- `Number `.
3046
+ `number `.
3047
3047
3048
- `Number ` values outside the range of [`Number.MIN_SAFE_INTEGER`][]
3048
+ `number ` values outside the range of [`Number.MIN_SAFE_INTEGER`][]
3049
3049
`-(2**53 - 1)` - [`Number.MAX_SAFE_INTEGER`][] `(2**53 - 1)` will lose
3050
3050
precision.
3051
3051
@@ -3076,7 +3076,7 @@ napi_status napi_get_value_string_latin1(napi_env env,
3076
3076
* `[out] result`: Number of bytes copied into the buffer, excluding the null
3077
3077
terminator.
3078
3078
3079
- Returns `napi_ok` if the API succeeded. If a non-`String ` `napi_value`
3079
+ Returns `napi_ok` if the API succeeded. If a non-`string ` `napi_value`
3080
3080
is passed in it returns `napi_string_expected`.
3081
3081
3082
3082
This API returns the ISO-8859-1-encoded string corresponding the value passed
@@ -3106,7 +3106,7 @@ napi_status napi_get_value_string_utf8(napi_env env,
3106
3106
* `[out] result`: Number of bytes copied into the buffer, excluding the null
3107
3107
terminator.
3108
3108
3109
- Returns `napi_ok` if the API succeeded. If a non-`String ` `napi_value`
3109
+ Returns `napi_ok` if the API succeeded. If a non-`string ` `napi_value`
3110
3110
is passed in it returns `napi_string_expected`.
3111
3111
3112
3112
This API returns the UTF8-encoded string corresponding the value passed in.
@@ -3135,7 +3135,7 @@ napi_status napi_get_value_string_utf16(napi_env env,
3135
3135
* `[out] result`: Number of 2-byte code units copied into the buffer, excluding
3136
3136
the null terminator.
3137
3137
3138
- Returns `napi_ok` if the API succeeded. If a non-`String ` `napi_value`
3138
+ Returns `napi_ok` if the API succeeded. If a non-`string ` `napi_value`
3139
3139
is passed in it returns `napi_string_expected`.
3140
3140
3141
3141
This API returns the UTF16-encoded string corresponding the value passed in.
@@ -3153,7 +3153,7 @@ napi_status napi_get_value_uint32(napi_env env,
3153
3153
```
3154
3154
3155
3155
* `[in] env`: The environment that the API is invoked under.
3156
- * `[in] value`: `napi_value` representing JavaScript `Number `.
3156
+ * `[in] value`: `napi_value` representing JavaScript `number `.
3157
3157
* `[out] result`: C primitive equivalent of the given `napi_value` as a
3158
3158
`uint32_t`.
3159
3159
@@ -3243,8 +3243,8 @@ of the [ECMAScript Language Specification][].
3243
3243
3244
3244
These APIs support doing one of the following:
3245
3245
3246
- 1. Coerce JavaScript values to specific JavaScript types (such as `Number ` or
3247
- `String `).
3246
+ 1. Coerce JavaScript values to specific JavaScript types (such as `number ` or
3247
+ `string `).
3248
3248
2. Check the type of a JavaScript value.
3249
3249
3. Check for equality between two JavaScript values.
3250
3250
@@ -3284,7 +3284,7 @@ napi_status napi_coerce_to_number(napi_env env,
3284
3284
3285
3285
* `[in] env`: The environment that the API is invoked under.
3286
3286
* `[in] value`: The JavaScript value to coerce.
3287
- * `[out] result`: `napi_value` representing the coerced JavaScript `Number `.
3287
+ * `[out] result`: `napi_value` representing the coerced JavaScript `number `.
3288
3288
3289
3289
Returns `napi_ok` if the API succeeded.
3290
3290
@@ -3328,7 +3328,7 @@ napi_status napi_coerce_to_string(napi_env env,
3328
3328
3329
3329
* `[in] env`: The environment that the API is invoked under.
3330
3330
* `[in] value`: The JavaScript value to coerce.
3331
- * `[out] result`: `napi_value` representing the coerced JavaScript `String `.
3331
+ * `[out] result`: `napi_value` representing the coerced JavaScript `string `.
3332
3332
3333
3333
Returns `napi_ok` if the API succeeded.
3334
3334
@@ -3612,7 +3612,7 @@ following forms:
3612
3612
* Named: a simple UTF8-encoded string
3613
3613
* Integer-Indexed: an index value represented by `uint32_t`
3614
3614
* JavaScript value: these are represented in Node-API by `napi_value`. This can
3615
- be a `napi_value` representing a `String `, `Number `, or `Symbol `.
3615
+ be a `napi_value` representing a `string `, `number `, or `symbol `.
3616
3616
3617
3617
Node-API values are represented by the type `napi_value`.
3618
3618
Any Node-API call that requires a JavaScript value takes in a `napi_value`.
@@ -3807,7 +3807,7 @@ typedef struct {
3807
3807
} napi_property_descriptor;
3808
3808
```
3809
3809
3810
- * `utf8name`: Optional `String` describing the key for the property,
3810
+ * `utf8name`: Optional string describing the key for the property,
3811
3811
encoded as UTF8. One of `utf8name` or `name` must be provided for the
3812
3812
property.
3813
3813
* `name`: Optional `napi_value` that points to a JavaScript string or symbol
@@ -4003,8 +4003,8 @@ napi_status napi_has_own_property(napi_env env,
4003
4003
Returns `napi_ok` if the API succeeded.
4004
4004
4005
4005
This API checks if the `Object` passed in has the named own property. `key` must
4006
- be a string or a `Symbol `, or an error will be thrown. Node-API will not perform
4007
- any conversion between data types.
4006
+ be a ` string` or a `symbol `, or an error will be thrown. Node-API will not
4007
+ perform any conversion between data types.
4008
4008
4009
4009
#### napi_set_named_property
4010
4010
<!-- YAML
@@ -4281,7 +4281,7 @@ NAPI_EXTERN napi_status napi_call_function(napi_env env,
4281
4281
```
4282
4282
4283
4283
* `[in] env`: The environment that the API is invoked under.
4284
- * `[in] recv`: The `this` object passed to the called function.
4284
+ * `[in] recv`: The `this` value passed to the called function.
4285
4285
* `[in] func`: `napi_value` representing the JavaScript function to be invoked.
4286
4286
* `[in] argc`: The count of elements in the `argv` array.
4287
4287
* `[in] argv`: Array of `napi_values` representing JavaScript values passed in
@@ -5247,7 +5247,7 @@ NAPI_EXTERN napi_status napi_make_callback(napi_env env,
5247
5247
for `async_context` does not result in an error. However, this results
5248
5248
in incorrect operation of async hooks. Potential issues include loss of
5249
5249
async context when using the `AsyncLocalStorage` API.
5250
- * `[in] recv`: The `this` object passed to the called function.
5250
+ * `[in] recv`: The `this` value passed to the called function.
5251
5251
* `[in] func`: `napi_value` representing the JavaScript function to be invoked.
5252
5252
* `[in] argc`: The count of elements in the `argv` array.
5253
5253
* `[in] argv`: Array of JavaScript values as `napi_value` representing the
0 commit comments