Skip to content

Commit 6c07523

Browse files
mhdawsonTrott
authored andcommitted
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: nodejs#28738 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent f9c267e commit 6c07523

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

doc/api/n-api.md

+4
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,8 @@ Implementations of this type of function should avoid making any N-API calls
463463
that could result in the execution of JavaScript or interaction with
464464
JavaScript objects. Most often, any code that needs to make N-API
465465
calls should be made in `napi_async_complete_callback` instead.
466+
Avoid using the `napi_env` parameter in the execute callback as
467+
it will likely execute JavaScript.
466468

467469
#### napi_async_complete_callback
468470
<!-- YAML
@@ -4028,6 +4030,8 @@ The `execute` function should avoid making any N-API calls
40284030
that could result in the execution of JavaScript or interaction with
40294031
JavaScript objects. Most often, any code that needs to make N-API
40304032
calls should be made in `complete` callback instead.
4033+
Avoid using the `napi_env` parameter in the execute callback as
4034+
it will likely execute JavaScript.
40314035

40324036
These functions implement the following interfaces:
40334037

0 commit comments

Comments
 (0)