Skip to content

Commit

Permalink
doc: amplify warning for execute callback
Browse files Browse the repository at this point in the history
Add specific recommendation not to use the
to the napi-env parameter in napi_async_execute_callback
  • Loading branch information
mhdawson committed Jul 17, 2019
1 parent 54fcb14 commit 8d6203f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions doc/api/n-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,10 @@ typedef void (*napi_async_execute_callback)(napi_env env, void* data);
Implementations of this type of function should avoid making any N-API calls
that could result in the execution of JavaScript or interaction with
JavaScript objects. Most often, any code that needs to make N-API
calls should be made in `napi_async_complete_callback` instead.
calls should be made in `napi_async_complete_callback` instead. The
current recommendation is to avoid all usage of the
napi_env parameter in the execute callback as it will most
likely cause JavaScript to be executed.

#### napi_async_complete_callback
<!-- YAML
Expand Down Expand Up @@ -4027,7 +4030,10 @@ task respectively.
The `execute` function should avoid making any N-API calls
that could result in the execution of JavaScript or interaction with
JavaScript objects. Most often, any code that needs to make N-API
calls should be made in `complete` callback instead.
calls should be made in `complete` callback instead. The
current recommendation is to avoid all usage of the
napi_env parameter in the execute callback as it will most
likely cause JavaScript to be executed.

These functions implement the following interfaces:

Expand Down

0 comments on commit 8d6203f

Please sign in to comment.