diff options
author | Michael Dawson <michael_dawson@ca.ibm.com> | 2018-04-30 12:13:20 -0400 |
---|---|---|
committer | Michael Dawson <michael_dawson@ca.ibm.com> | 2018-05-03 18:53:10 -0400 |
commit | 4740e5dd8a8ced108f40dbcf8375c6fe62ca10cf (patch) | |
tree | b7dc3dbc823173003feff3db1f592b00a542bbaa /doc | |
parent | b3c757e07a6883e77279747fb522b215460fdbbf (diff) | |
download | node-new-4740e5dd8a8ced108f40dbcf8375c6fe62ca10cf.tar.gz |
doc: cleanup n-api.md doc
Partial doc cleanup as per
https://github.com/nodejs/node/issues/20421
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/n-api.md | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 3ba902f1df..12b3975022 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -40,7 +40,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) @@ -73,7 +73,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, @@ -589,7 +591,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; } @@ -626,7 +628,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; } @@ -2486,10 +2488,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 |