aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_task.rs
diff options
context:
space:
mode:
authorMs2ger <Ms2ger@gmail.com>2015-11-09 16:55:58 +0100
committerMs2ger <Ms2ger@gmail.com>2015-11-12 10:48:58 +0100
commit6d2ae85c1fc1c31c2dff9b9f9309943ed503e8c1 (patch)
tree0433f0f8a3a3ba8489108e0711c0e86ce443b0e0 /components/script/script_task.rs
parentacb24e80b87d043173e2e8b2a31ef3fdb610767b (diff)
downloadservo-6d2ae85c1fc1c31c2dff9b9f9309943ed503e8c1.tar.gz
servo-6d2ae85c1fc1c31c2dff9b9f9309943ed503e8c1.zip
Use the conversion traits from js.
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 99312a61bd6..e97a8141dbe 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()
};