We should bring the AlreadyInCompartment and InCompartment types into this crate (renaming them to AlreadyInRealm and InRealm in the process), and make the assert method take a *mut JSObject object instead. This will allow us to add a InCompartment argument to ToJSValConvertible, avoiding a source of crashes.
https://github.com/servo/servo/blob/da559d47b93854e4c7d4acf0a0d2029a9e643794/components/script/compartments.rs
We should bring the AlreadyInCompartment and InCompartment types into this crate (renaming them to AlreadyInRealm and InRealm in the process), and make the
assert
method take a*mut JSObject
object instead. This will allow us to add aInCompartment
argument to ToJSValConvertible, avoiding a source of crashes.