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

@ -20,7 +20,7 @@ use dom::window::{base64_atob, base64_btoa};
use dom::workerlocation::WorkerLocation;
use dom::workernavigator::WorkerNavigator;
use ipc_channel::ipc::IpcSender;
use js::jsapi::{HandleValue, JSContext, JSRuntime};
use js::jsapi::{HandleValue, JSAutoCompartment, JSContext, JSRuntime};
use js::jsval::UndefinedValue;
use js::rust::Runtime;
use msg::constellation_msg::{PipelineId, ReferrerPolicy};
@ -382,8 +382,9 @@ impl WorkerGlobalScope {
// https://github.com/servo/servo/issues/6422
println!("evaluate_script failed");
unsafe {
report_pending_exception(
self.runtime.cx(), self.reflector().get_jsobject().get());
let _ac = JSAutoCompartment::new(self.runtime.cx(),
self.reflector().get_jsobject().get());
report_pending_exception(self.runtime.cx());
}
}
}