Make report_pending_exception unsafe

This commit is contained in:
Anthony Ramine 2016-06-07 00:26:49 +02:00
parent bc52617d33
commit 27620320f3
3 changed files with 12 additions and 8 deletions

View file

@ -416,6 +416,7 @@ impl WorkerGlobalScopeMethods for WorkerGlobalScope {
impl WorkerGlobalScope {
#[allow(unsafe_code)]
pub fn execute_script(&self, source: DOMString) {
let mut rval = RootedValue::new(self.runtime.cx(), UndefinedValue());
match self.runtime.evaluate_script(
@ -428,7 +429,10 @@ impl WorkerGlobalScope {
// TODO: An error needs to be dispatched to the parent.
// https://github.com/servo/servo/issues/6422
println!("evaluate_script failed");
report_pending_exception(self.runtime.cx(), self.reflector().get_jsobject().get());
unsafe {
report_pending_exception(
self.runtime.cx(), self.reflector().get_jsobject().get());
}
}
}
}