@@ -37,8 +37,7 @@ properties:
37
37
The N-API is a C API that ensures ABI stability across Node.js versions
38
38
and different compiler levels. A C++ API can be easier to use.
39
39
To support using C++, the project maintains a
40
- C++ wrapper module called
41
- [node-addon-api](https://github.com/nodejs/node-addon-api).
40
+ C++ wrapper module called [node-addon-api][].
42
41
This wrapper provides an inlineable C++ API. Binaries built
43
42
with `node-addon-api` will depend on the symbols for the N-API C-based
44
43
functions exported by Node.js. `node-addon-api` is a more
@@ -1557,8 +1556,7 @@ API.
1557
1556
1558
1557
## Working with JavaScript Values
1559
1558
N-API exposes a set of APIs to create all types of JavaScript values.
1560
- Some of these types are documented under
1561
- [Section 6](https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values)
1559
+ Some of these types are documented under [Section 6][]
1562
1560
of the [ECMAScript Language Specification][].
1563
1561
1564
1562
Fundamentally, these APIs are used to do one of the following:
@@ -1594,9 +1592,7 @@ typedef enum {
1594
1592
```
1595
1593
1596
1594
Describes the type of a `napi_value`. This generally corresponds to the types
1597
- described in
1598
- [Section 6.1](https://tc39.github.io/ecma262/#sec-ecmascript-language-types) of
1599
- the ECMAScript Language Specification.
1595
+ described in [Section 6.1][] of the ECMAScript Language Specification.
1600
1596
In addition to types in that section, `napi_valuetype` can also represent
1601
1597
`Function`s and `Object`s with external data.
1602
1598
@@ -1926,8 +1922,7 @@ Returns `napi_ok` if the API succeeded.
1926
1922
This API allocates a default JavaScript `Object`.
1927
1923
It is the equivalent of doing `new Object()` in JavaScript.
1928
1924
1929
- The JavaScript `Object` type is described in
1930
- [Section 6.1.7](https://tc39.github.io/ecma262/#sec-object-type) of the
1925
+ The JavaScript `Object` type is described in [Section 6.1.7][] of the
1931
1926
ECMAScript Language Specification.
1932
1927
1933
1928
#### napi_create_symbol
@@ -1951,8 +1946,7 @@ Returns `napi_ok` if the API succeeded.
1951
1946
1952
1947
This API creates a JavaScript `Symbol` object from a UTF8-encoded C string.
1953
1948
1954
- The JavaScript `Symbol` type is described in
1955
- [Section 19.4](https://tc39.github.io/ecma262/#sec-symbol-objects)
1949
+ The JavaScript `Symbol` type is described in [Section 19.4][]
1956
1950
of the ECMAScript Language Specification.
1957
1951
1958
1952
#### napi_create_typedarray
@@ -2093,11 +2087,8 @@ This API is used to convert from the C `int64_t` type to the JavaScript
2093
2087
The JavaScript `Number` type is described in [Section 6.1.6][]
2094
2088
of the ECMAScript Language Specification. Note the complete range of `int64_t`
2095
2089
cannot be represented with full precision in JavaScript. Integer values
2096
- outside the range of
2097
- [`Number.MIN_SAFE_INTEGER`](https://tc39.github.io/ecma262/#sec-number.min_safe_integer)
2098
- -(2^53 - 1) -
2099
- [`Number.MAX_SAFE_INTEGER`](https://tc39.github.io/ecma262/#sec-number.max_safe_integer)
2100
- (2^53 - 1) will lose precision.
2090
+ outside the range of [`Number.MIN_SAFE_INTEGER`][] `-(2^53 - 1)` -
2091
+ [`Number.MAX_SAFE_INTEGER`][] `(2^53 - 1)` will lose precision.
2101
2092
2102
2093
#### napi_create_double
2103
2094
<!-- YAML
@@ -2296,9 +2287,8 @@ Returns `napi_ok` if the API succeeded.
2296
2287
2297
2288
This API returns the length of an array.
2298
2289
2299
- `Array` length is described in
2300
- [Section 22.1.4.1](https://tc39.github.io/ecma262/#sec-properties-of-array-instances-length)
2301
- of the ECMAScript Language Specification.
2290
+ `Array` length is described in [Section 22.1.4.1][] of the ECMAScript Language
2291
+ Specification.
2302
2292
2303
2293
#### napi_get_arraybuffer_info
2304
2294
<!-- YAML
@@ -2671,11 +2661,8 @@ is passed in it returns `napi_number_expected`.
2671
2661
This API returns the C `int64` primitive equivalent of the given JavaScript
2672
2662
`Number`.
2673
2663
2674
- `Number` values outside the range of
2675
- [`Number.MIN_SAFE_INTEGER`](https://tc39.github.io/ecma262/#sec-number.min_safe_integer)
2676
- -(2^53 - 1) -
2677
- [`Number.MAX_SAFE_INTEGER`](https://tc39.github.io/ecma262/#sec-number.max_safe_integer)
2678
- (2^53 - 1) will lose precision.
2664
+ `Number` values outside the range of [`Number.MIN_SAFE_INTEGER`][]
2665
+ `-(2^53 - 1)` - [`Number.MAX_SAFE_INTEGER`][] `(2^53 - 1)` will lose precision.
2679
2666
2680
2667
Non-finite number values (`NaN`, `+Infinity`, or `-Infinity`) set the
2681
2668
result to zero.
@@ -2863,8 +2850,7 @@ This API returns the Undefined object.
2863
2850
## Working with JavaScript Values - Abstract Operations
2864
2851
2865
2852
N-API exposes a set of APIs to perform some abstract operations on JavaScript
2866
- values. Some of these operations are documented under
2867
- [Section 7](https://tc39.github.io/ecma262/#sec-abstract-operations)
2853
+ values. Some of these operations are documented under [Section 7][]
2868
2854
of the [ECMAScript Language Specification][].
2869
2855
2870
2856
These APIs support doing one of the following:
@@ -2893,8 +2879,7 @@ napi_status napi_coerce_to_bool(napi_env env,
2893
2879
Returns `napi_ok` if the API succeeded.
2894
2880
2895
2881
This API implements the abstract operation `ToBoolean()` as defined in
2896
- [Section 7.1.2](https://tc39.github.io/ecma262/#sec-toboolean)
2897
- of the ECMAScript Language Specification.
2882
+ [Section 7.1.2][] of the ECMAScript Language Specification.
2898
2883
This API can be re-entrant if getters are defined on the passed-in `Object`.
2899
2884
2900
2885
### napi_coerce_to_number
@@ -2916,8 +2901,7 @@ napi_status napi_coerce_to_number(napi_env env,
2916
2901
Returns `napi_ok` if the API succeeded.
2917
2902
2918
2903
This API implements the abstract operation `ToNumber()` as defined in
2919
- [Section 7.1.3](https://tc39.github.io/ecma262/#sec-tonumber)
2920
- of the ECMAScript Language Specification.
2904
+ [Section 7.1.3][] of the ECMAScript Language Specification.
2921
2905
This API can be re-entrant if getters are defined on the passed-in `Object`.
2922
2906
2923
2907
### napi_coerce_to_object
@@ -2939,8 +2923,7 @@ napi_status napi_coerce_to_object(napi_env env,
2939
2923
Returns `napi_ok` if the API succeeded.
2940
2924
2941
2925
This API implements the abstract operation `ToObject()` as defined in
2942
- [Section 7.1.13](https://tc39.github.io/ecma262/#sec-toobject)
2943
- of the ECMAScript Language Specification.
2926
+ [Section 7.1.13][] of the ECMAScript Language Specification.
2944
2927
This API can be re-entrant if getters are defined on the passed-in `Object`.
2945
2928
2946
2929
### napi_coerce_to_string
@@ -2962,8 +2945,7 @@ napi_status napi_coerce_to_string(napi_env env,
2962
2945
Returns `napi_ok` if the API succeeded.
2963
2946
2964
2947
This API implements the abstract operation `ToString()` as defined in
2965
- [Section 7.1.13](https://tc39.github.io/ecma262/#sec-tostring)
2966
- of the ECMAScript Language Specification.
2948
+ [Section 7.1.13][] of the ECMAScript Language Specification.
2967
2949
This API can be re-entrant if getters are defined on the passed-in `Object`.
2968
2950
2969
2951
### napi_typeof
@@ -3013,9 +2995,7 @@ is true.
3013
2995
Returns `napi_ok` if the API succeeded.
3014
2996
3015
2997
This API represents invoking the `instanceof` Operator on the object as
3016
- defined in
3017
- [Section 12.10.4](https://tc39.github.io/ecma262/#sec-instanceofoperator)
3018
- of the ECMAScript Language Specification.
2998
+ defined in [Section 12.10.4][] of the ECMAScript Language Specification.
3019
2999
3020
3000
### napi_is_array
3021
3001
<!-- YAML
@@ -3034,8 +3014,7 @@ napi_status napi_is_array(napi_env env, napi_value value, bool* result)
3034
3014
Returns `napi_ok` if the API succeeded.
3035
3015
3036
3016
This API represents invoking the `IsArray` operation on the object
3037
- as defined in [Section 7.2.2](https://tc39.github.io/ecma262/#sec-isarray)
3038
- of the ECMAScript Language Specification.
3017
+ as defined in [Section 7.2.2][] of the ECMAScript Language Specification.
3039
3018
3040
3019
### napi_is_arraybuffer
3041
3020
<!-- YAML
@@ -3167,15 +3146,12 @@ napi_status napi_strict_equals(napi_env env,
3167
3146
Returns `napi_ok` if the API succeeded.
3168
3147
3169
3148
This API represents the invocation of the Strict Equality algorithm as
3170
- defined in
3171
- [Section 7.2.14](https://tc39.github.io/ecma262/#sec-strict-equality-comparison)
3172
- of the ECMAScript Language Specification.
3149
+ defined in [Section 7.2.14][] of the ECMAScript Language Specification.
3173
3150
3174
3151
## Working with JavaScript Properties
3175
3152
3176
3153
N-API exposes a set of APIs to get and set properties on JavaScript
3177
- objects. Some of these types are documented under
3178
- [Section 7](https://tc39.github.io/ecma262/#sec-operations-on-objects) of the
3154
+ objects. Some of these types are documented under [Section 7][] of the
3179
3155
[ECMAScript Language Specification][].
3180
3156
3181
3157
Properties in JavaScript are represented as a tuple of a key and a value.
@@ -3388,7 +3364,7 @@ property to be a JavaScript function represented by `method`. If this is
3388
3364
passed in, set `value`, `getter` and `setter` to `NULL` (since these members
3389
3365
won't be used).
3390
3366
* `attributes`: The attributes associated with the particular property.
3391
- See [`napi_property_attributes`](#n_api_napi_property_attributes) .
3367
+ See [`napi_property_attributes`][] .
3392
3368
* `data`: The callback data passed into `method`, `getter` and `setter` if
3393
3369
this function is invoked.
3394
3370
@@ -3889,9 +3865,8 @@ be associated with the resulting JavaScript function (which is returned in the
3889
3865
`result` parameter) and freed whenever the function is garbage-collected by
3890
3866
passing both the JavaScript function and the data to [`napi_add_finalizer`][].
3891
3867
3892
- JavaScript `Function`s are described in
3893
- [Section 19.2](https://tc39.github.io/ecma262/#sec-function-objects)
3894
- of the ECMAScript Language Specification.
3868
+ JavaScript `Function`s are described in [Section 19.2][] of the ECMAScript
3869
+ Language Specification.
3895
3870
3896
3871
### napi_get_cb_info
3897
3872
<!-- YAML
@@ -5146,18 +5121,33 @@ This API may only be called from the main thread.
5146
5121
[Native Abstractions for Node.js]: https://github.com/nodejs/nan
5147
5122
[Object Lifetime Management]: #n_api_object_lifetime_management
5148
5123
[Object Wrap]: #n_api_object_wrap
5124
+ [Section 6]: https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values
5125
+ [Section 6.1]: https://tc39.github.io/ecma262/#sec-ecmascript-language-types
5126
+ [Section 6.1.4]: https://tc39.github.io/ecma262/#sec-ecmascript-language-types-string-type
5127
+ [Section 6.1.6]: https://tc39.github.io/ecma262/#sec-ecmascript-language-types-number-type
5128
+ [Section 6.1.7]: https://tc39.github.io/ecma262/#sec-object-type
5129
+ [Section 6.1.7.1]: https://tc39.github.io/ecma262/#table-2
5130
+ [Section 7]: https://tc39.github.io/ecma262/#sec-abstract-operations
5131
+ [Section 7.1.2]: https://tc39.github.io/ecma262/#sec-toboolean
5132
+ [Section 7.1.3]: https://tc39.github.io/ecma262/#sec-tonumber
5133
+ [Section 7.1.13]: https://tc39.github.io/ecma262/#sec-toobject
5134
+ [Section 7.2.2]: https://tc39.github.io/ecma262/#sec-isarray
5135
+ [Section 7.2.14]: https://tc39.github.io/ecma262/#sec-strict-equality-comparison
5136
+ [Section 8.7]: https://tc39.es/ecma262/#sec-agents
5137
+ [Section 9.1.6]: https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-defineownproperty-p-desc
5149
5138
[Section 12.5.5]: https://tc39.github.io/ecma262/#sec-typeof-operator
5139
+ [Section 12.10.4]: https://tc39.github.io/ecma262/#sec-instanceofoperator
5140
+ [Section 19.2]: https://tc39.github.io/ecma262/#sec-function-objects
5141
+ [Section 19.4]: https://tc39.github.io/ecma262/#sec-symbol-objects
5150
5142
[Section 20.3]: https://tc39.github.io/ecma262/#sec-date-objects
5151
5143
[Section 22.1]: https://tc39.github.io/ecma262/#sec-array-objects
5144
+ [Section 22.1.4.1]: https://tc39.github.io/ecma262/#sec-properties-of-array-instances-length
5152
5145
[Section 22.2]: https://tc39.github.io/ecma262/#sec-typedarray-objects
5153
5146
[Section 24.1]: https://tc39.github.io/ecma262/#sec-arraybuffer-objects
5154
5147
[Section 24.3]: https://tc39.github.io/ecma262/#sec-dataview-objects
5155
5148
[Section 25.4]: https://tc39.github.io/ecma262/#sec-promise-objects
5156
- [Section 6.1.4]: https://tc39.github.io/ecma262/#sec-ecmascript-language-types-string-type
5157
- [Section 6.1.6]: https://tc39.github.io/ecma262/#sec-ecmascript-language-types-number-type
5158
- [Section 6.1.7.1]: https://tc39.github.io/ecma262/#table-2
5159
- [Section 8.7]: https://tc39.es/ecma262/#sec-agents
5160
- [Section 9.1.6]: https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-defineownproperty-p-desc
5149
+ [`Number.MIN_SAFE_INTEGER`]: https://tc39.github.io/ecma262/#sec-number.min_safe_integer
5150
+ [`Number.MAX_SAFE_INTEGER`]: https://tc39.github.io/ecma262/#sec-number.max_safe_integer
5161
5151
[Working with JavaScript Functions]: #n_api_working_with_javascript_functions
5162
5152
[Working with JavaScript Properties]: #n_api_working_with_javascript_properties
5163
5153
[Working with JavaScript Values - Abstract Operations]: #n_api_working_with_javascript_values_abstract_operations
@@ -5196,6 +5186,7 @@ This API may only be called from the main thread.
5196
5186
[`napi_open_callback_scope`]: #n_api_napi_open_callback_scope
5197
5187
[`napi_open_escapable_handle_scope`]: #n_api_napi_open_escapable_handle_scope
5198
5188
[`napi_open_handle_scope`]: #n_api_napi_open_handle_scope
5189
+ [`napi_property_attributes`]: #n_api_napi_property_attributes
5199
5190
[`napi_property_descriptor`]: #n_api_napi_property_descriptor
5200
5191
[`napi_queue_async_work`]: #n_api_napi_queue_async_work
5201
5192
[`napi_reference_ref`]: #n_api_napi_reference_ref
@@ -5212,4 +5203,5 @@ This API may only be called from the main thread.
5212
5203
[`uv_unref`]: http://docs.libuv.org/en/v1.x/handle.html#c.uv_unref
5213
5204
[async_hooks `type`]: async_hooks.html#async_hooks_type
5214
5205
[context-aware addons]: addons.html#addons_context_aware_addons
5206
+ [node-addon-api]: https://github.com/nodejs/node-addon-api
5215
5207
[worker threads]: https://nodejs.org/api/worker_threads.html
0 commit comments