Skip to content

Commit ab58ab1

Browse files
committed
doc: cleanup n-api.md doc
Partial doc cleanup as per #20421
1 parent 109cfa1 commit ab58ab1

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

doc/api/n-api.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ there to be one or more C++ wrapper modules that provide an inlineable C++
5656
API. Binaries built with these wrapper modules will depend on the symbols
5757
for the N-API C based functions exported by Node.js. These wrappers are not
5858
part of N-API, nor will they be maintained as part of Node.js. One such
59-
example is: [node-api](https://github.com/nodejs/node-api).
59+
example is: [node-addon-api](https://github.com/nodejs/node-addon-api).
6060

6161
In order to use the N-API functions, include the file
6262
[node_api.h](https://github.com/nodejs/node/blob/master/src/node_api.h)
@@ -89,7 +89,9 @@ typedef enum {
8989
napi_generic_failure,
9090
napi_pending_exception,
9191
napi_cancelled,
92-
napi_status_last
92+
napi_escape_called_twice,
93+
napi_handle_scope_mismatch,
94+
napi_callback_scope_mismatch
9395
} napi_status;
9496
```
9597
If additional information is required upon an API returning a failed status,
@@ -605,7 +607,7 @@ that has a loop which iterates through the elements in a large array:
605607
```C
606608
for (int i = 0; i < 1000000; i++) {
607609
napi_value result;
608-
napi_status status = napi_get_element(e, object, i, &result);
610+
napi_status status = napi_get_element(env, object, i, &result);
609611
if (status != napi_ok) {
610612
break;
611613
}
@@ -642,7 +644,7 @@ for (int i = 0; i < 1000000; i++) {
642644
break;
643645
}
644646
napi_value result;
645-
status = napi_get_element(e, object, i, &result);
647+
status = napi_get_element(env, object, i, &result);
646648
if (status != napi_ok) {
647649
break;
648650
}
@@ -2495,10 +2497,10 @@ performed using a N-API call).
24952497
property to be a JavaScript function represented by `method`. If this is
24962498
passed in, set `value`, `getter` and `setter` to `NULL` (since these members
24972499
won't be used).
2498-
- `data`: The callback data passed into `method`, `getter` and `setter` if
2499-
this function is invoked.
25002500
- `attributes`: The attributes associated with the particular property.
25012501
See [`napi_property_attributes`](#n_api_napi_property_attributes).
2502+
- `data`: The callback data passed into `method`, `getter` and `setter` if
2503+
this function is invoked.
25022504

25032505
### Functions
25042506
#### napi_get_property_names

0 commit comments

Comments
 (0)