Skip to content

Commit 6eec3fc

Browse files
mhdawsonMylesBorins
authored andcommitted
doc: cleanup n-api.md doc
Partial doc cleanup as per #20421 PR-URL: #20430 Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Gabriel Schulhof <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent a6299d6 commit 6eec3fc

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
@@ -55,7 +55,7 @@ there to be one or more C++ wrapper modules that provide an inlineable C++
5555
API. Binaries built with these wrapper modules will depend on the symbols
5656
for the N-API C based functions exported by Node.js. These wrappers are not
5757
part of N-API, nor will they be maintained as part of Node.js. One such
58-
example is: [node-api](https://github.com/nodejs/node-api).
58+
example is: [node-addon-api](https://github.com/nodejs/node-addon-api).
5959

6060
In order to use the N-API functions, include the file
6161
[node_api.h](https://github.com/nodejs/node/blob/master/src/node_api.h)
@@ -88,7 +88,9 @@ typedef enum {
8888
napi_generic_failure,
8989
napi_pending_exception,
9090
napi_cancelled,
91-
napi_status_last
91+
napi_escape_called_twice,
92+
napi_handle_scope_mismatch,
93+
napi_callback_scope_mismatch
9294
} napi_status;
9395
```
9496
If additional information is required upon an API returning a failed status,
@@ -610,7 +612,7 @@ that has a loop which iterates through the elements in a large array:
610612
```C
611613
for (int i = 0; i < 1000000; i++) {
612614
napi_value result;
613-
napi_status status = napi_get_element(e, object, i, &result);
615+
napi_status status = napi_get_element(env, object, i, &result);
614616
if (status != napi_ok) {
615617
break;
616618
}
@@ -647,7 +649,7 @@ for (int i = 0; i < 1000000; i++) {
647649
break;
648650
}
649651
napi_value result;
650-
status = napi_get_element(e, object, i, &result);
652+
status = napi_get_element(env, object, i, &result);
651653
if (status != napi_ok) {
652654
break;
653655
}
@@ -2484,10 +2486,10 @@ performed using a N-API call).
24842486
property to be a JavaScript function represented by `method`. If this is
24852487
passed in, set `value`, `getter` and `setter` to `NULL` (since these members
24862488
won't be used).
2487-
- `data`: The callback data passed into `method`, `getter` and `setter` if
2488-
this function is invoked.
24892489
- `attributes`: The attributes associated with the particular property.
24902490
See [`napi_property_attributes`](#n_api_napi_property_attributes).
2491+
- `data`: The callback data passed into `method`, `getter` and `setter` if
2492+
this function is invoked.
24912493

24922494
### Functions
24932495
#### napi_get_property_names

0 commit comments

Comments
 (0)