@@ -40,7 +40,7 @@ there to be one or more C++ wrapper modules that provide an inlineable C++
40
40
API. Binaries built with these wrapper modules will depend on the symbols
41
41
for the N-API C based functions exported by Node.js. These wrappers are not
42
42
part of N-API, nor will they be maintained as part of Node.js. One such
43
- example is: [node-api](https://github.com/nodejs/node-api).
43
+ example is: [node-addon- api](https://github.com/nodejs/node-addon -api).
44
44
45
45
In order to use the N-API functions, include the file
46
46
[`node_api.h`](https://github.com/nodejs/node/blob/master/src/node_api.h)
@@ -73,7 +73,9 @@ typedef enum {
73
73
napi_generic_failure,
74
74
napi_pending_exception,
75
75
napi_cancelled,
76
- napi_status_last
76
+ napi_escape_called_twice,
77
+ napi_handle_scope_mismatch,
78
+ napi_callback_scope_mismatch
77
79
} napi_status;
78
80
```
79
81
If additional information is required upon an API returning a failed status,
@@ -589,7 +591,7 @@ that has a loop which iterates through the elements in a large array:
589
591
```C
590
592
for (int i = 0; i < 1000000; i++) {
591
593
napi_value result;
592
- napi_status status = napi_get_element(e , object, i, &result);
594
+ napi_status status = napi_get_element(env , object, i, &result);
593
595
if (status != napi_ok) {
594
596
break;
595
597
}
@@ -626,7 +628,7 @@ for (int i = 0; i < 1000000; i++) {
626
628
break;
627
629
}
628
630
napi_value result;
629
- status = napi_get_element(e , object, i, &result);
631
+ status = napi_get_element(env , object, i, &result);
630
632
if (status != napi_ok) {
631
633
break;
632
634
}
@@ -2486,10 +2488,10 @@ performed using a N-API call).
2486
2488
property to be a JavaScript function represented by `method`. If this is
2487
2489
passed in, set `value`, `getter` and `setter` to `NULL` (since these members
2488
2490
won't be used).
2489
- - `data`: The callback data passed into `method`, `getter` and `setter` if
2490
- this function is invoked.
2491
2491
- `attributes`: The attributes associated with the particular property.
2492
2492
See [`napi_property_attributes`](#n_api_napi_property_attributes).
2493
+ - `data`: The callback data passed into `method`, `getter` and `setter` if
2494
+ this function is invoked.
2493
2495
2494
2496
### Functions
2495
2497
#### napi_get_property_names
0 commit comments