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(napi): clear currently registering module slot #19249

Merged
merged 12 commits into from
May 26, 2023

Conversation

bartlomieju
Copy link
Member

@bartlomieju bartlomieju commented May 25, 2023

This commit fixes problem with loading N-API modules that use
the "old" way of registration (using "napi_module_register" API).
The slot was not cleared after loading modules, causing subsequent
calls that use the new way of registration (using
"napi_register_module_v1" API) to try and load the previous module.

Ref #16460

@littledivy littledivy marked this pull request as ready for review May 25, 2023 13:10
env: napi_env,
exports: napi_value,
) -> napi_value>(b"napi_register_module_v1")
.expect("napi_register_module_v1 not found");
Copy link
Member Author

Choose a reason for hiding this comment

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

This should probably be an error instead of a panic, trying to load a broken dylib shouldn't bring down the runtime

Copy link
Member Author

Choose a reason for hiding this comment

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

But we can address it in a follow up

@littledivy littledivy merged commit 512d533 into denoland:main May 26, 2023
@bartlomieju bartlomieju deleted the napi_parcel_bug branch May 26, 2023 04:41
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