doc: amplify warning for execute callback

Add specific recommendation not to use the
to the napi-env parameter in napi_async_execute_callback

PR-URL: https://github.com/nodejs/node/pull/28738
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Michael Dawson 2019-07-17 14:39:56 -04:00 committed by Rich Trott
parent f9c267e951
commit 6c075238b0

View File

@ -463,6 +463,8 @@ Implementations of this type of function should avoid making any N-API calls
that could result in the execution of JavaScript or interaction with that could result in the execution of JavaScript or interaction with
JavaScript objects. Most often, any code that needs to make N-API 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.
Avoid using the `napi_env` parameter in the execute callback as
it will likely execute JavaScript.
#### napi_async_complete_callback #### napi_async_complete_callback
<!-- YAML <!-- YAML
@ -4028,6 +4030,8 @@ The `execute` function should avoid making any N-API calls
that could result in the execution of JavaScript or interaction with that could result in the execution of JavaScript or interaction with
JavaScript objects. Most often, any code that needs to make N-API 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.
Avoid using the `napi_env` parameter in the execute callback as
it will likely execute JavaScript.
These functions implement the following interfaces: These functions implement the following interfaces: