script/realms.rs
1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5use js::context::JSContext;
6use js::realm::AutoRealm;
7use script_bindings::reflector::DomObject;
8
9pub(crate) fn enter_auto_realm<'cx>(
10 cx: &'cx mut JSContext,
11 object: &impl DomObject,
12) -> AutoRealm<'cx> {
13 script_bindings::realms::enter_auto_realm::<crate::DomTypeHolder>(cx, object)
14}