mirror of
https://github.com/servo/servo.git
synced 2025-08-09 15:35:34 +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
|
@ -221,6 +221,7 @@ impl FromJSValConvertible for DOMString {
|
|||
/// Convert the given `JSString` to a `DOMString`. Fails if the string does not
|
||||
/// contain valid UTF-16.
|
||||
pub unsafe fn jsstring_to_str(cx: *mut JSContext, s: *mut JSString) -> DOMString {
|
||||
assert!(!s.is_null());
|
||||
let latin1 = JS_DeprecatedStringHasLatin1Chars(s);
|
||||
DOMString::from_string(if latin1 {
|
||||
latin1_to_string(cx, s)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue