-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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: add clarification for exception behaviour #25339
Conversation
Refs: nodejs/abi-stable-node#356 Document current behaviour where some methods can be called when an exception is pending, while others cannot and explain the behaviour.
doc/api/n-api.md
Outdated
called in order to allow for some minimal cleanup to be completed | ||
before returning to JavaScript. For those functions, `napi_status` | ||
will reflect the success/error/exception for that function, irrespective of | ||
whether an exception was pending when the function was called. |
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.
This sentence is difficult to understand. "for that function" is particularly confusing coming after "for those functions". Maybe try writing it as two shorter sentences or something? Or just tidying up the sentence that's there somehow?
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.
Maybe something like this?
In that case, `napi_status` will reflect the status for the function.
It will not reflect previous pending exceptions.
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.
(Obviously, change my suggestion if it is factually incorrect. I'm commenting on style and readability, not content.)
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.
Your suggestion works for me. Updating.
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 with @Trott’s suggestions
Co-Authored-By: mhdawson <michael_dawson@ca.ibm.com>
Co-Authored-By: mhdawson <michael_dawson@ca.ibm.com>
Co-Authored-By: mhdawson <michael_dawson@ca.ibm.com>
@Trott fixed up as per your comments. |
Landed in b406c9c. |
Document current behaviour where some methods can be called when an exception is pending, while others cannot and explain the behaviour. PR-URL: #25339 Refs: nodejs/abi-stable-node#356 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Document current behaviour where some methods can be called when an exception is pending, while others cannot and explain the behaviour. PR-URL: #25339 Refs: nodejs/abi-stable-node#356 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Document current behaviour where some methods can be called when an exception is pending, while others cannot and explain the behaviour. PR-URL: nodejs#25339 Refs: nodejs/abi-stable-node#356 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Document current behaviour where some methods can be called when an exception is pending, while others cannot and explain the behaviour. PR-URL: #25339 Refs: nodejs/abi-stable-node#356 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Document current behaviour where some methods can be called when an exception is pending, while others cannot and explain the behaviour. PR-URL: #25339 Refs: nodejs/abi-stable-node#356 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Document current behaviour where some methods can be called when an exception is pending, while others cannot and explain the behaviour. PR-URL: #25339 Refs: nodejs/abi-stable-node#356 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Refs: nodejs/abi-stable-node#356
Document current behaviour where some methods can be called
when an exception is pending, while others cannot and explain
the behaviour.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes