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 bugs (1/n) #16230

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

Fix Node-API bugs (1/n) #16230

wants to merge 8 commits into from

Conversation

190n
Copy link
Contributor

@190n 190n commented Jan 8, 2025

What does this PR do?

This should only be merged after #15437 and #16223 are merged (because those are broad Node-API refactors, and merging more Node-API stuff into main will just make more conflicts for merging those PRs).

This is a few commits from #14501 split into a separate PR. Fixes:

  • Properties would not be marked read-only
  • Read-only properties would have setters (Read-only instance accessors defined through Node-API incorrectly have setters #15429)
  • napi_define_class did not check if all its arguments are NULL
  • All napi_coerce functions didn't handle exceptions correctly
  • napi_get_value_bool didn't handle non-booleans correctly
  • Constructor functions would get NULL from napi_get_cb_info instead of the data pointer provided when the class was created

How did you verify your code works?

Current Node-API tests pass.

@robobun
Copy link

robobun commented Jan 8, 2025

Updated 6:59 PM PT - Jan 7th, 2025

@190n, your commit b3387f4 has 1 failures in #9148:


🧪   try this PR locally:

bunx bun-pr 16230

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.

2 participants