-
Notifications
You must be signed in to change notification settings - Fork 284
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
napi: why napi can be called in async execute function? #1998
Comments
ping @nodejs/n-api |
Yeah, I mean, this just seems like a bug in the test (we should use |
addaleax
added a commit
to addaleax/node
that referenced
this issue
Jun 25, 2019
The `Execute()` callback is not allowed to call into JS, so we should use `assert()` instead of potentially throwing JS errors. Fixes: nodejs/help#1998
3 tasks
@heroboy would you like to submit a PR for that? Otherwise, I'll look at doing that. |
Nevermind seems like there is already a PR that has been submitted to fix. |
targos
pushed a commit
to nodejs/node
that referenced
this issue
Jul 2, 2019
The `Execute()` callback is not allowed to call into JS, so we should use `assert()` instead of potentially throwing JS errors. PR-URL: #28423 Fixes: nodejs/help#1998 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
targos
pushed a commit
to nodejs/node
that referenced
this issue
Jul 2, 2019
The `Execute()` callback is not allowed to call into JS, so we should use `assert()` instead of potentially throwing JS errors. PR-URL: #28423 Fixes: nodejs/help#1998 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/nodejs/node/blob/938e11882b96e19b443477571455088baaa054d8/test/node-api/test_async/test_async.cc#L24
See this function ,it calls
napi_throw_type_error
.In the document:https://nodejs.org/docs/latest/api/n-api.html#n_api_napi_create_async_work, executor is called in another thread, so it can't call any napi function.
The text was updated successfully, but these errors were encountered: