aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_task.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2015-11-13 01:13:52 +0530
committerbors-servo <lbergstrom+bors@mozilla.com>2015-11-13 01:13:52 +0530
commitb40882093a306032d38ad02e30f0095e0a49ec21 (patch)
tree2709c0ebc9d4a6e5ed7a86f7cb73298832bab158 /components/script/script_task.rs
parent022b06e564b2556d671476ddad392d1f86ce45d6 (diff)
parent6d2ae85c1fc1c31c2dff9b9f9309943ed503e8c1 (diff)
downloadservo-b40882093a306032d38ad02e30f0095e0a49ec21.tar.gz
servo-b40882093a306032d38ad02e30f0095e0a49ec21.zip
Auto merge of #8428 - Ms2ger:conversions, r=Manishearth
Update js. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8428) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/script_task.rs')
-rw-r--r--components/script/script_task.rs12
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()
};