aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2015-07-11 09:32:32 +0200
committerMs2ger <ms2ger@gmail.com>2015-07-11 09:32:32 +0200
commit243446eff33d596b192a7190d5dfe3bb1a6e07dd (patch)
tree77c449b1fecb01d4938800e6fbe525eebdd24125 /components
parent0f36eeab61b233cbcf0274e985ebd07b45d7a44f (diff)
downloadservo-243446eff33d596b192a7190d5dfe3bb1a6e07dd.tar.gz
servo-243446eff33d596b192a7190d5dfe3bb1a6e07dd.zip
Revert "Replace surrogates in JS strings with U+FFFD instead of panicking."
This reverts commit 3f07f8e8661e7ebd451af3aef247212708083bc5.
Diffstat (limited to 'components')
-rw-r--r--components/script/dom/bindings/conversions.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/components/script/dom/bindings/conversions.rs b/components/script/dom/bindings/conversions.rs
index 1a090a1ef63..9967b6cf9b7 100644
--- a/components/script/dom/bindings/conversions.rs
+++ b/components/script/dom/bindings/conversions.rs
@@ -355,9 +355,7 @@ pub fn jsstring_to_str(cx: *mut JSContext, s: *mut JSString) -> DOMString {
let char_vec = unsafe {
slice::from_raw_parts(chars as *const u16, length as usize)
};
- // This is a wilful spec violation.
- // See https://github.com/servo/servo/issues/6564
- String::from_utf16_lossy(char_vec)
+ String::from_utf16(char_vec).unwrap()
}
}