-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: update napi_make_callback documentation #35321
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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_context
is not resulting in using the current async context instead an empty context (id 0) is used.Using
NULL
is like usingnode::Makecallback
withoutasync_context
which is deprecated since Node.js 10 (DEP0099).fixes: #35188