mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Revert "Replace surrogates in JS strings with U+FFFD instead of panicking."
This reverts commit 3f07f8e866
.
This commit is contained in:
parent
0f36eeab61
commit
243446eff3
1 changed files with 1 additions and 3 deletions
|
@ -355,9 +355,7 @@ pub fn jsstring_to_str(cx: *mut JSContext, s: *mut JSString) -> DOMString {
|
||||||
let char_vec = unsafe {
|
let char_vec = unsafe {
|
||||||
slice::from_raw_parts(chars as *const u16, length as usize)
|
slice::from_raw_parts(chars as *const u16, length as usize)
|
||||||
};
|
};
|
||||||
// This is a wilful spec violation.
|
String::from_utf16(char_vec).unwrap()
|
||||||
// See https://github.com/servo/servo/issues/6564
|
|
||||||
String::from_utf16_lossy(char_vec)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue