Skip to content
This repository was archived by the owner on Nov 12, 2022. It is now read-only.

Exports of mozjs_sys::jsgc::* #546

Open
redfire75369 opened this issue Jul 4, 2021 · 2 comments
Open

Exports of mozjs_sys::jsgc::* #546

redfire75369 opened this issue Jul 4, 2021 · 2 comments

Comments

@redfire75369
Copy link
Contributor

redfire75369 commented Jul 4, 2021

RootedGuard<'_, T> requires that T implement mozjs_sys::jsgc::RootKind.

This issues involves exporting mozjs_sys::jsgc::* in mozjs.

Reason

Currently, I am unable to create a generic function that does this as this struct is not exported by mozjs. This will be useful for creating utility functions to set a value without requiring you to manually convert it using ToJSValConvertible.

Implementation Code

// src/lib.rs

pub use mozjs_sys::jsgc;
@jdm
Copy link
Member

jdm commented Jul 4, 2021

mozjs_sys is a separate crate at https://github.com/servo/mozjs/blob/ef986b1a2c23081fe4d37aeaab5323d3dec033f3/src/jsgc.rs#L20, so you can depend on that without changing this crate.

@redfire75369
Copy link
Contributor Author

redfire75369 commented Aug 1, 2021

It is possible to depend on both simultaneously, but due to mozjs depending mozjs_sys as well, you have to specify the exact commit of mozjs_sys that your current version of mozjs uses. This means it is more difficult and inconvenient to update mozjs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants