Skip to content
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

[v14.x-backport] node-api: rtn pending excep on napi_new_instance #39516

Closed

Conversation

legendecas
Copy link
Member

When there are any JavaScript exceptions pending,
napi_pending_exception should be returned.

PR-URL: #38798
Reviewed-By: Anna Henningsen anna@addaleax.net
Reviewed-By: Michael Dawson midawson@redhat.com

@github-actions github-actions bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. v14.x labels Jul 25, 2021
@legendecas legendecas changed the title node-api: rtn pending excep on napi_new_instance [v14.x-backport] node-api: rtn pending excep on napi_new_instance Jul 25, 2021
@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So … this looks good, but:

When I reviewed the original PR, the reason I approved that this was a bugfix that aligned this call site with other call sites.

However, this prompted me to take another look at the source, it seems that CHECK_MAYBE_EMPTY most often uses napi_generic_failure – which seems pretty wrong? An empty maybe by definition indicates a pending exception.

@legendecas
Copy link
Member Author

legendecas commented Jul 26, 2021

@addaleax previously we consider this returning status change as a possible ABI breaking change. However, the original PR does resolve a real problem, which we considered as a bug of node core. I believe it is time to re-evaluate if such a change is breaking anymore. If it is not been categorized as an ABI breaking change, we should apply the change on all other similar call sites.

/cc @nodejs/node-api

@legendecas legendecas added the node-api Issues and PRs related to the Node-API. label Jul 26, 2021
@addaleax
Copy link
Member

@legendecas Yeah, I think this is either an all-or-nothing situation.

However, the original PR does resolve a real problem

But the same goes for the other call sites…?

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@targos
Copy link
Member

targos commented Aug 8, 2021

Can you please rebase?

@targos
Copy link
Member

targos commented Aug 29, 2021

ping @legendecas

@legendecas
Copy link
Member Author

@targos updated! :)

When there are any JavaScript exceptions pending,
`napi_pending_exception` should be returned.

PR-URL: nodejs#38798
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <midawson@redhat.com>
targos pushed a commit that referenced this pull request Sep 3, 2021
When there are any JavaScript exceptions pending,
`napi_pending_exception` should be returned.

PR-URL: #38798
Backport-PR-URL: #39516
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <midawson@redhat.com>
@targos
Copy link
Member

targos commented Sep 3, 2021

Landed in a74032a

@targos targos closed this Sep 3, 2021
@legendecas legendecas deleted the backport-to-14/38798 branch March 25, 2022 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. node-api Issues and PRs related to the Node-API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants