mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Create a helper API for entering a DOM object's compartment
Revert some unnecessary changes Fix fmt errors
This commit is contained in:
parent
84786add22
commit
adb402487e
14 changed files with 45 additions and 50 deletions
|
@ -2,6 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use crate::compartments::enter_realm;
|
||||
use crate::dom::bindings::cell::DomRefCell;
|
||||
use crate::dom::bindings::conversions::{root_from_handleobject, ToJSValConvertible};
|
||||
use crate::dom::bindings::error::{throw_dom_exception, Error};
|
||||
|
@ -548,7 +549,7 @@ impl WindowProxy {
|
|||
((*get_object_class(window_jsobject.get())).flags & JSCLASS_IS_GLOBAL),
|
||||
0
|
||||
);
|
||||
let _ac = JSAutoRealm::new(cx, window_jsobject.get());
|
||||
let _ac = enter_realm(&*window);
|
||||
|
||||
// The old window proxy no longer owns this browsing context.
|
||||
SetProxyReservedSlot(old_js_proxy.get(), 0, &PrivateValue(ptr::null_mut()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue