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 crash when napi_register_module_v1 returns nullptr #16816

Merged
merged 8 commits into from
Jan 28, 2025

Conversation

190n
Copy link
Contributor

@190n 190n commented Jan 27, 2025

What does this PR do?

Ensures that if napi_register_module_v1 returns nullptr, we use the exports object as the return value of require(). This matches Node.js behavior.

Fixes #16766

How did you verify your code works?

  • I included a test for the new code, or existing tests cover it
  • I ran my tests locally and they pass (bun-debug test test-file-name.test)

@robobun
Copy link

robobun commented Jan 27, 2025

Updated 7:53 PM PT - Jan 27th, 2025

@190n, your commit ad0b185 has 1 failures in Build #10678:


🧪   try this PR locally:

bunx bun-pr 16816

@190n 190n requested review from a team and paperclover and removed request for a team January 28, 2025 02:48
@Jarred-Sumner Jarred-Sumner merged commit 71eb147 into main Jan 28, 2025
68 of 69 checks passed
@Jarred-Sumner Jarred-Sumner deleted the ben/napi-register-module-null branch January 28, 2025 04:13
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.

import duckdb crashs bun
4 participants