mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Handle failed string conversions in console.log. (#33085)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
4df7a1af25
commit
3829e91662
2 changed files with 4 additions and 0 deletions
|
@ -73,6 +73,9 @@ where
|
|||
unsafe fn handle_value_to_string(cx: *mut jsapi::JSContext, value: HandleValue) -> DOMString {
|
||||
rooted!(in(cx) let mut js_string = std::ptr::null_mut::<jsapi::JSString>());
|
||||
js_string.set(JS_ValueToSource(cx, value));
|
||||
if js_string.is_null() {
|
||||
return "<error converting value to string>".into();
|
||||
}
|
||||
jsstring_to_str(cx, *js_string)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue