Make sure wrapcallback is used#762
Closed
gabrielschulhof wants to merge 2 commits intonodejs:masterfrom
Closed
Conversation
mhdawson
approved these changes
Jul 9, 2020
Member
mhdawson
left a comment
There was a problem hiding this comment.
LGTM, @gabrielschulhof I assume the extra overhead of another call is not going to be significant as finalization is not too common?
Contributor
Author
|
@mhdawson it should be inlined. |
Member
|
@gabrielschulhof I assume you mean by the compiler, if so that makes sense as I see you have it marked as inline |
Contributor
Author
|
@mhdawson, yeah, sorry, I meant by the compiler. |
Contributor
Author
|
I believe this is blocked by #773. |
fe30826 to
c1cdb39
Compare
Contributor
Author
|
Rebased on top of #773. I had to change the child process to examine the exception in the process' |
c1cdb39 to
db0af19
Compare
Contributor
Author
Contributor
Author
|
New CI: |
gabrielschulhof
pushed a commit
that referenced
this pull request
Aug 6, 2020
Make sure C++ exceptions thrown from a finalizer are converted into JS exceptions just as they are in regular callbacks. Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com> PR-URL: #762 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> test: add finalizer exception test src: wrap finalizer callback
Contributor
Author
|
Landed in cec2c76. |
kevindavies8
added a commit
to kevindavies8/node-addon-api-Develop
that referenced
this pull request
Aug 24, 2022
Make sure C++ exceptions thrown from a finalizer are converted into JS exceptions just as they are in regular callbacks. Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com> PR-URL: nodejs/node-addon-api#762 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> test: add finalizer exception test src: wrap finalizer callback
Marlyfleitas
added a commit
to Marlyfleitas/node-api-addon-Development
that referenced
this pull request
Aug 26, 2022
Make sure C++ exceptions thrown from a finalizer are converted into JS exceptions just as they are in regular callbacks. Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com> PR-URL: nodejs/node-addon-api#762 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> test: add finalizer exception test src: wrap finalizer callback
wroy7860
added a commit
to wroy7860/addon-api-benchmark-node
that referenced
this pull request
Sep 19, 2022
Make sure C++ exceptions thrown from a finalizer are converted into JS exceptions just as they are in regular callbacks. Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com> PR-URL: nodejs/node-addon-api#762 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> test: add finalizer exception test src: wrap finalizer callback
johnfrench3
pushed a commit
to johnfrench3/node-addon-api-git
that referenced
this pull request
Aug 11, 2023
Make sure C++ exceptions thrown from a finalizer are converted into JS exceptions just as they are in regular callbacks. Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com> PR-URL: nodejs/node-addon-api#762 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> test: add finalizer exception test src: wrap finalizer callback
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Finalizers are also able to call JS code and therefore throw. Thus, when calling the user's finalizer, we should wrap it in our C++-to-JS-exception converter.