aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/callback.rs
diff options
context:
space:
mode:
authorMs2ger <Ms2ger@gmail.com>2016-08-26 17:58:46 +0200
committerMs2ger <Ms2ger@gmail.com>2016-08-26 17:59:31 +0200
commit5662f0d34646c1e2940216b0a3317fd62a54aeb7 (patch)
treeb156f6a1d0ef1600e219c0327c7144486458cf51 /components/script/dom/bindings/callback.rs
parent3b11c5ea2d3d6e68d4f9609e5e2a81056bfb27d0 (diff)
downloadservo-5662f0d34646c1e2940216b0a3317fd62a54aeb7.tar.gz
servo-5662f0d34646c1e2940216b0a3317fd62a54aeb7.zip
Remove the JSAutoCompartment from report_pending_exception.
It doesn't really belong there.
Diffstat (limited to 'components/script/dom/bindings/callback.rs')
-rw-r--r--components/script/dom/bindings/callback.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/components/script/dom/bindings/callback.rs b/components/script/dom/bindings/callback.rs
index c34598a26be..c7a09fcc4d8 100644
--- a/components/script/dom/bindings/callback.rs
+++ b/components/script/dom/bindings/callback.rs
@@ -8,6 +8,7 @@ use dom::bindings::error::{Error, Fallible, report_pending_exception};
use dom::bindings::global::global_root_from_object;
use dom::bindings::reflector::Reflectable;
use js::jsapi::GetGlobalForObjectCrossCompartment;
+use js::jsapi::JSAutoCompartment;
use js::jsapi::JS_GetProperty;
use js::jsapi::{Heap, MutableHandleObject, RootedObject};
use js::jsapi::{IsCallable, JSContext, JSObject, JS_WrapObject};
@@ -189,7 +190,8 @@ impl<'a> Drop for CallSetup<'a> {
unsafe {
JS_LeaveCompartment(self.cx, self.old_compartment);
if self.handling == ExceptionHandling::Report {
- report_pending_exception(self.cx, *self.exception_compartment);
+ let _ac = JSAutoCompartment::new(self.cx, *self.exception_compartment);
+ report_pending_exception(self.cx);
}
}
}