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

fix: node-api function call should use preamble #26297

Merged
merged 1 commit into from
Oct 16, 2024
Merged

Conversation

devsnek
Copy link
Member

@devsnek devsnek commented Oct 16, 2024

napi_call_function should use our equiv of NAPI_PREAMBLE (&mut Env instead of *mut Env) since it needs to set error codes based on whether the body of the function raised a JS exception.

Fixes: #26282

Copy link
Contributor

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

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

Nice! Let's add a test case if possible.

Copy link
Contributor

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@devsnek devsnek enabled auto-merge (squash) October 16, 2024 10:03
@devsnek devsnek merged commit ea9c3ff into main Oct 16, 2024
17 checks passed
@devsnek devsnek deleted the fix-function-call branch October 16, 2024 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

N-API bug related to error handling
2 participants