Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b2d6eb7

Browse filesBrowse files
mhdawsonMylesBorins
authored andcommitted
doc: cleanup n-api.md doc
Partial doc cleanup as per #20421 PR-URL: #20430 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent e553747 commit b2d6eb7
Copy full SHA for b2d6eb7

File tree

Expand file treeCollapse file tree

1 file changed

+8
-6
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-6
lines changed
Open diff view settings
Collapse file

‎doc/api/n-api.md‎

Copy file name to clipboardExpand all lines: doc/api/n-api.md
+8-6Lines changed: 8 additions & 6 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ there to be one or more C++ wrapper modules that provide an inlineable C++
4040
API. Binaries built with these wrapper modules will depend on the symbols
4141
for the N-API C based functions exported by Node.js. These wrappers are not
4242
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).
4444

4545
In order to use the N-API functions, include the file
4646
[`node_api.h`](https://github.com/nodejs/node/blob/master/src/node_api.h)
@@ -73,7 +73,9 @@ typedef enum {
7373
napi_generic_failure,
7474
napi_pending_exception,
7575
napi_cancelled,
76-
napi_status_last
76+
napi_escape_called_twice,
77+
napi_handle_scope_mismatch,
78+
napi_callback_scope_mismatch
7779
} napi_status;
7880
```
7981
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:
589591
```C
590592
for (int i = 0; i < 1000000; i++) {
591593
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);
593595
if (status != napi_ok) {
594596
break;
595597
}
@@ -626,7 +628,7 @@ for (int i = 0; i < 1000000; i++) {
626628
break;
627629
}
628630
napi_value result;
629-
status = napi_get_element(e, object, i, &result);
631+
status = napi_get_element(env, object, i, &result);
630632
if (status != napi_ok) {
631633
break;
632634
}
@@ -2486,10 +2488,10 @@ performed using a N-API call).
24862488
property to be a JavaScript function represented by `method`. If this is
24872489
passed in, set `value`, `getter` and `setter` to `NULL` (since these members
24882490
won't be used).
2489-
- `data`: The callback data passed into `method`, `getter` and `setter` if
2490-
this function is invoked.
24912491
- `attributes`: The attributes associated with the particular property.
24922492
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.
24932495

24942496
### Functions
24952497
#### napi_get_property_names

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.