-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
N-API Callback Return #13562
Comments
The documentation is out of date. You can return a typedef napi_value (*napi_callback)(napi_env env, napi_callback_info info); |
jasongin
added
doc
Issues and PRs related to the documentations.
node-api
Issues and PRs related to the Node-API.
labels
Jun 8, 2017
Thank you very much @jasongin |
3 tasks
I'll clarify this in a doc PR next week. |
mhdawson
added a commit
to mhdawson/io.js
that referenced
this issue
Jun 15, 2017
- Add doc for napi_create_string_latin1(). - Fix signatures where c string was specified instead of napi_value. - Fix return type of napi_callback. - Update to specify that napi_escape_handle() can only be called once for a given scope. Fixes: nodejs#13555 Fixes: nodejs#13556 Fixes: nodejs#13562
mhdawson
added a commit
that referenced
this issue
Jun 16, 2017
- Add doc for napi_create_string_latin1(). - Fix signatures where c string was specified instead of napi_value. - Fix return type of napi_callback. - Update to specify that napi_escape_handle() can only be called once for a given scope. PR-URL: #13650 Fixes: #13555 Fixes: #13556 Fixes: #13562 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jason Ginchereau <jasongin@microsoft.com> Reviewed-By: Ingvar Stepanyan <me@rreverser.com>
addaleax
pushed a commit
that referenced
this issue
Jun 17, 2017
The earlier version `napi_callback` returns `void` but now is `napi_value`. The document of this section hasn't been modified. PR-URL: #13570 Fixes: #12248 Fixes: #13562 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jason Ginchereau <jasongin@microsoft.com> Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax
pushed a commit
that referenced
this issue
Jun 17, 2017
- Add doc for napi_create_string_latin1(). - Fix signatures where c string was specified instead of napi_value. - Fix return type of napi_callback. - Update to specify that napi_escape_handle() can only be called once for a given scope. PR-URL: #13650 Fixes: #13555 Fixes: #13556 Fixes: #13562 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jason Ginchereau <jasongin@microsoft.com> Reviewed-By: Ingvar Stepanyan <me@rreverser.com>
addaleax
pushed a commit
that referenced
this issue
Jun 21, 2017
The earlier version `napi_callback` returns `void` but now is `napi_value`. The document of this section hasn't been modified. PR-URL: #13570 Fixes: #12248 Fixes: #13562 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jason Ginchereau <jasongin@microsoft.com> Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax
pushed a commit
that referenced
this issue
Jun 21, 2017
- Add doc for napi_create_string_latin1(). - Fix signatures where c string was specified instead of napi_value. - Fix return type of napi_callback. - Update to specify that napi_escape_handle() can only be called once for a given scope. PR-URL: #13650 Fixes: #13555 Fixes: #13556 Fixes: #13562 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jason Ginchereau <jasongin@microsoft.com> Reviewed-By: Ingvar Stepanyan <me@rreverser.com>
gabrielschulhof
pushed a commit
to gabrielschulhof/node
that referenced
this issue
Apr 10, 2018
The earlier version `napi_callback` returns `void` but now is `napi_value`. The document of this section hasn't been modified. PR-URL: nodejs#13570 Fixes: nodejs#12248 Fixes: nodejs#13562 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jason Ginchereau <jasongin@microsoft.com> Reviewed-By: James M Snell <jasnell@gmail.com>
gabrielschulhof
pushed a commit
to gabrielschulhof/node
that referenced
this issue
Apr 10, 2018
- Add doc for napi_create_string_latin1(). - Fix signatures where c string was specified instead of napi_value. - Fix return type of napi_callback. - Update to specify that napi_escape_handle() can only be called once for a given scope. PR-URL: nodejs#13650 Fixes: nodejs#13555 Fixes: nodejs#13556 Fixes: nodejs#13562 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jason Ginchereau <jasongin@microsoft.com> Reviewed-By: Ingvar Stepanyan <me@rreverser.com>
MylesBorins
pushed a commit
that referenced
this issue
Apr 16, 2018
The earlier version `napi_callback` returns `void` but now is `napi_value`. The document of this section hasn't been modified. Backport-PR-URL: #19447 PR-URL: #13570 Fixes: #12248 Fixes: #13562 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jason Ginchereau <jasongin@microsoft.com> Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins
pushed a commit
that referenced
this issue
Apr 16, 2018
- Add doc for napi_create_string_latin1(). - Fix signatures where c string was specified instead of napi_value. - Fix return type of napi_callback. - Update to specify that napi_escape_handle() can only be called once for a given scope. Backport-PR-URL: #19447 PR-URL: #13650 Fixes: #13555 Fixes: #13556 Fixes: #13562 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jason Ginchereau <jasongin@microsoft.com> Reviewed-By: Ingvar Stepanyan <me@rreverser.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think N-API doesn't have any documented way for return something from callbacks. we have just
napi_get_cb_info
for reading information fromnapi_callback_info
and there is no specific way for write something into them but in documentation mention that it can be used for Set the return value of the callbackThe text was updated successfully, but these errors were encountered: