Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: doc cleanup #20430

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions doc/api/n-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ there to be one or more C++ wrapper modules that provide an inlineable C++
API. Binaries built with these wrapper modules will depend on the symbols
for the N-API C based functions exported by Node.js. These wrappers are not
part of N-API, nor will they be maintained as part of Node.js. One such
example is: [node-api](https://github.com/nodejs/node-api).
example is: [node-addon-api](https://github.com/nodejs/node-addon-api).

In order to use the N-API functions, include the file
[node_api.h](https://github.com/nodejs/node/blob/master/src/node_api.h)
Expand Down Expand Up @@ -89,7 +89,9 @@ typedef enum {
napi_generic_failure,
napi_pending_exception,
napi_cancelled,
napi_status_last
napi_escape_called_twice,
napi_handle_scope_mismatch,
napi_callback_scope_mismatch
} napi_status;
```
If additional information is required upon an API returning a failed status,
Expand Down Expand Up @@ -605,7 +607,7 @@ that has a loop which iterates through the elements in a large array:
```C
for (int i = 0; i < 1000000; i++) {
napi_value result;
napi_status status = napi_get_element(e, object, i, &result);
napi_status status = napi_get_element(env, object, i, &result);
if (status != napi_ok) {
break;
}
Expand Down Expand Up @@ -642,7 +644,7 @@ for (int i = 0; i < 1000000; i++) {
break;
}
napi_value result;
status = napi_get_element(e, object, i, &result);
status = napi_get_element(env, object, i, &result);
if (status != napi_ok) {
break;
}
Expand Down Expand Up @@ -2495,10 +2497,10 @@ performed using a N-API call).
property to be a JavaScript function represented by `method`. If this is
passed in, set `value`, `getter` and `setter` to `NULL` (since these members
won't be used).
- `data`: The callback data passed into `method`, `getter` and `setter` if
this function is invoked.
- `attributes`: The attributes associated with the particular property.
See [`napi_property_attributes`](#n_api_napi_property_attributes).
- `data`: The callback data passed into `method`, `getter` and `setter` if
this function is invoked.

### Functions
#### napi_get_property_names
Expand Down