Skip to content

Conversation

@legendecas
Copy link
Member

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

Related: nodejs/node-addon-api#1000

When there are any JavaScript exceptions pending,
`napi_pending_exception` should be returned.
@legendecas legendecas added the node-api Issues and PRs related to the Node-API. label May 24, 2021
@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. labels May 24, 2021
Comment on lines +64 to +65
// Ignore status and check napi_is_exception_pending() instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

This comment looks a bit misplaced. Am I correct?

Suggested change
// Ignore status and check napi_is_exception_pending() instead.
// Ignore status and check napi_is_exception_pending() instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

Eh, maybe not. The comment is actually for the line above, which means that the omitting of the checks on the returning status is intentional.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see. Perhaps it would be better to put the comment above the call (and the variable declaration)? If this is a convention in the codebase no problem then.

@nodejs-github-bot
Copy link
Collaborator

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

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

mhdawson pushed a commit that referenced this pull request Jun 4, 2021
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>
@mhdawson
Copy link
Member

mhdawson commented Jun 4, 2021

Landed in 78af363

@mhdawson mhdawson closed this Jun 4, 2021
@bl-ue
Copy link
Contributor

bl-ue commented Jun 4, 2021

@mhdawson for my own education: did you shorten rtn and excep to keep the commit message title under 50 chars?

@richardlau
Copy link
Member

This needs #37217 to land on v14.x first (or needs to be manually backported).

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.

7 participants