diff options
Diffstat (limited to 'components/script/script_task.rs')
-rw-r--r-- | components/script/script_task.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/components/script/script_task.rs b/components/script/script_task.rs index a824c3fb3dd..48972b3fe70 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -1683,11 +1683,13 @@ impl ScriptTask { let script_source = String::from_utf8_lossy(&script_source_bytes); // Script source is ready to be evaluated (11.) - let mut jsval = RootedValue::new(self.get_cx(), UndefinedValue()); - window.evaluate_js_on_global_with_result(&script_source, jsval.handle_mut()); - let strval = DOMString::from_jsval(self.get_cx(), jsval.handle(), - StringificationBehavior::Empty); - strval.unwrap_or(DOMString::new()) + unsafe { + let mut jsval = RootedValue::new(self.get_cx(), UndefinedValue()); + window.evaluate_js_on_global_with_result(&script_source, jsval.handle_mut()); + let strval = DOMString::from_jsval(self.get_cx(), jsval.handle(), + StringificationBehavior::Empty); + strval.unwrap_or(DOMString::new()) + } } else { DOMString::new() }; |