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

Can't add intrinsics to AsyncRuntime #375

Open
chyyran opened this issue Oct 25, 2024 · 0 comments
Open

Can't add intrinsics to AsyncRuntime #375

chyyran opened this issue Oct 25, 2024 · 0 comments

Comments

@chyyran
Copy link

chyyran commented Oct 25, 2024

pub(crate) struct CustomIntrinsic;

impl Intrinsic for CustomIntrinsic {
    unsafe fn add_intrinsic(ctx: NonNull<rquickjs::qjs::JSContext>) {
        let this = unsafe {
            Ctx::from_raw(ctx)
        };
        this.globals();
    }
}

...

// this panics with `tried to cource js value Int(0) to the wrong type, this is a rquickjs bug`
let context = AsyncContext::custom::<CustomIntrinsic>(&runtime).await?;
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

No branches or pull requests

1 participant