mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Eval'ing int32's in devtools panic'd
This commit is contained in:
parent
3c88d3418c
commit
17e6b08265
1 changed files with 10 additions and 3 deletions
|
@ -25,7 +25,12 @@ use std::sync::mpsc::Sender;
|
|||
use std::rc::Rc;
|
||||
|
||||
|
||||
pub fn handle_evaluate_js(page: &Rc<Page>, pipeline: PipelineId, eval: String, reply: Sender<EvaluateJSReply>){
|
||||
pub fn handle_evaluate_js(
|
||||
page: &Rc<Page>,
|
||||
pipeline: PipelineId,
|
||||
eval: String,
|
||||
reply: Sender<EvaluateJSReply>
|
||||
) {
|
||||
let page = get_page(&*page, pipeline);
|
||||
let window = page.window();
|
||||
let cx = window.r().get_cx();
|
||||
|
@ -36,8 +41,10 @@ pub fn handle_evaluate_js(page: &Rc<Page>, pipeline: PipelineId, eval: String, r
|
|||
EvaluateJSReply::VoidValue
|
||||
} else if rval.ptr.is_boolean() {
|
||||
EvaluateJSReply::BooleanValue(rval.ptr.to_boolean())
|
||||
} else if rval.ptr.is_double() {
|
||||
EvaluateJSReply::NumberValue(FromJSValConvertible::from_jsval(cx, rval.handle(), ()).unwrap())
|
||||
} else if rval.ptr.is_double() || rval.ptr.is_int32() {
|
||||
EvaluateJSReply::NumberValue(
|
||||
FromJSValConvertible::from_jsval(cx, rval.handle(), ()).unwrap()
|
||||
)
|
||||
} else if rval.ptr.is_string() {
|
||||
//FIXME: use jsstring_to_str when jsval grows to_jsstring
|
||||
EvaluateJSReply::StringValue(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue