handle null for evaluating JS value. #4235

This commit is contained in:
Jerry Shih 2014-12-04 23:06:27 -08:00 committed by Josh Matthews
parent fcaa45fb67
commit 3b4ebd7cd0

View file

@ -37,9 +37,11 @@ pub fn handle_evaluate_js(page: &Rc<Page>, pipeline: PipelineId, eval: String, r
} else if rval.is_string() {
//FIXME: use jsstring_to_str when jsval grows to_jsstring
devtools_traits::StringValue(FromJSValConvertible::from_jsval(cx, rval, conversions::Default).unwrap())
} else if rval.is_null() {
devtools_traits::NullValue
} else {
//FIXME: jsvals don't have an is_int32/is_number yet
assert!(rval.is_object_or_null());
assert!(rval.is_object());
panic!("object values unimplemented")
});
}