aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/eventtarget.rs
diff options
context:
space:
mode:
authorKamil Niski <kamil.niski@gmail.com>2019-05-04 11:27:21 +0200
committerKamil Niski <kamil.niski@gmail.com>2019-06-29 19:23:17 +0200
commitadb402487e7f8bf2cd0a1db360b16592f5c654ed (patch)
treecd04a40769e20f2a2c63c5eff914dedc4c745e62 /components/script/dom/eventtarget.rs
parent84786add227f2c0a675f4bcca708ac8a70011f6c (diff)
downloadservo-adb402487e7f8bf2cd0a1db360b16592f5c654ed.tar.gz
servo-adb402487e7f8bf2cd0a1db360b16592f5c654ed.zip
Create a helper API for entering a DOM object's compartment
Revert some unnecessary changes Fix fmt errors
Diffstat (limited to 'components/script/dom/eventtarget.rs')
-rw-r--r--components/script/dom/eventtarget.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/components/script/dom/eventtarget.rs b/components/script/dom/eventtarget.rs
index b5376b88945..02cd36bdd69 100644
--- a/components/script/dom/eventtarget.rs
+++ b/components/script/dom/eventtarget.rs
@@ -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::beforeunloadevent::BeforeUnloadEvent;
use crate::dom::bindings::callback::{CallbackContainer, CallbackFunction, ExceptionHandling};
use crate::dom::bindings::cell::DomRefCell;
@@ -506,7 +507,7 @@ impl EventTarget {
let scopechain = AutoObjectVectorWrapper::new(cx);
- let _ac = JSAutoRealm::new(cx, window.reflector().get_jsobject().get());
+ let _ac = enter_realm(&*window);
rooted!(in(cx) let mut handler = ptr::null_mut::<JSFunction>());
let rv = unsafe {
CompileFunction(