Remove the JSAutoCompartment from report_pending_exception.

It doesn't really belong there.
This commit is contained in:
Ms2ger 2016-08-26 17:58:46 +02:00
parent 3b11c5ea2d
commit 5662f0d346
5 changed files with 11 additions and 10 deletions

View file

@ -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);
}
}
}