Skip to content

Commit

Permalink
doc: fix out of date napi_callback doc
Browse files Browse the repository at this point in the history
The earlier version `napi_callback` returns `void` but now is
`napi_value`. The document of this section hasn't been modified.

Fixes: nodejs#12248
  • Loading branch information
XadillaX committed Jun 9, 2017
1 parent 8208fda commit 286979e
Showing 1 changed file with 3 additions and 2 deletions.
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);
```
#### *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

0 comments on commit 286979e

Please sign in to comment.