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 NRE in native host JSReference #96

Merged
merged 1 commit into from
Apr 14, 2023
Merged

Conversation

jasongin
Copy link
Member

Fixes: #93

The NativeHost runs in a special "no-context" environment in which JSRuntimeContext.Current is null. JSReference can support that by getting the napi_env handle from the current JSValueScope instead of the runtime context.

Copy link
Contributor

@rijulg rijulg left a comment

Choose a reason for hiding this comment

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

Looks good to me, I tried to solve it and open a PR but you solved it first 😅

Copy link
Member

@vmoroz vmoroz left a comment

Choose a reason for hiding this comment

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

LGTM

@jasongin jasongin merged commit 0b80148 into main Apr 14, 2023
@jasongin jasongin deleted the dev/jasongin/nativehost-ref branch April 23, 2023 07:04
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.

Host throws exception when initialized multiple times by JS workers
3 participants