doc: update napi_make_callback documentation#35321
doc: update napi_make_callback documentation#35321Flarna wants to merge 1 commit intonodejs:masterfrom
Conversation
Calling napi_make_callback() with no async_context is not resulting in using the current async context instead an empty context (id 0) is used. Using NULL is like using node::Makecallback without async_context which is deprecated since Node.js 10 (DEP0099).
|
Review requested:
|
|
@Flarna you are suggesting that this should be a doc issue rather than actual bug that should be fixed, am I got it right? As per #35188 (comment) IIUC this can be considered a bug that needs to be fixed in the code (and backported). |
|
I know there is a subtle difference: I'm not even sure if this can be fixed in code. It would require to "detect" the current context and use it without calling any async hook callback. I see the risk that such a "fix" changes the behavior of a lot addons in the wild. |
|
Doc only so linters already run are good enough, landing |
Calling napi_make_callback() with no async_context is not resulting in using the current async context instead an empty context (id 0) is used. Using NULL is like using node::Makecallback without async_context which is deprecated since Node.js 10 (DEP0099). PR-URL: #35321 Fixes: #35188 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
|
Landed in 03c4ee9 |
Calling napi_make_callback() with no async_context is not resulting in using the current async context instead an empty context (id 0) is used. Using NULL is like using node::Makecallback without async_context which is deprecated since Node.js 10 (DEP0099). PR-URL: #35321 Fixes: #35188 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
Calling napi_make_callback() with no async_context is not resulting in using the current async context instead an empty context (id 0) is used. Using NULL is like using node::Makecallback without async_context which is deprecated since Node.js 10 (DEP0099). PR-URL: nodejs#35321 Fixes: nodejs#35188 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
Calling
napi_make_callback()with noasync_contextis not resulting in using the current async context instead an empty context (id 0) is used.Using
NULLis like usingnode::Makecallbackwithoutasync_contextwhich is deprecated since Node.js 10 (DEP0099).fixes: #35188