1use js::context::JSContext;
6use js::jsapi::JSAutoRealm;
7use js::realm::AutoRealm;
8pub(crate) use script_bindings::realms::{AlreadyInRealm, InRealm};
9use script_bindings::reflector::DomObject;
10
11pub(crate) fn enter_realm(object: &impl DomObject) -> JSAutoRealm {
12 script_bindings::realms::enter_realm::<crate::DomTypeHolder>(object)
13}
14
15pub(crate) fn enter_auto_realm<'cx>(
16 cx: &'cx mut JSContext,
17 object: &impl DomObject,
18) -> AutoRealm<'cx> {
19 script_bindings::realms::enter_auto_realm::<crate::DomTypeHolder>(cx, object)
20}