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: fix out of date napi_callback doc #13570

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
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
5 changes: 3 additions & 2 deletions doc/api/n-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Function pointer type for user-provided native functions which are to be
exposed to JavaScript via N-API. Callback functions should satisfy the
following signature:
```C
typedef void (*napi_callback)(napi_env, napi_callback_info);
typedef napi_value (*napi_callback)(napi_env, napi_callback_info);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also update the section above about napi_callback_info: it is no longer used to set the return value.

Copy link
Contributor Author

@XadillaX XadillaX Jun 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. 👌 @jasongin

```

#### *napi_finalize*
Expand Down Expand Up @@ -2521,8 +2521,9 @@ In order to expose a function as part of the
add-on's module exports, set the newly created function on the exports
object. A sample module might look as follows:
```C
void SayHello(napi_env env, napi_callback_info info) {
napi_value SayHello(napi_env env, napi_callback_info info) {
printf("Hello\n");
return nullptr;
}

void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
Expand Down