Replaced DOMString constructor by conversion functions.

Replaced DOMString(...) by DOMString::from(...).
Replaced ....0 by String::from(...).
Removed any uses of .to_owner() in DOMString::from("...").
This commit is contained in:
Alan Jeffrey 2015-11-11 16:26:53 -06:00
parent 736323a779
commit 84bde75b42
64 changed files with 256 additions and 254 deletions

View file

@ -159,7 +159,8 @@ impl FromJSValConvertible for USVString {
}
let latin1 = JS_StringHasLatin1Chars(jsstr);
if latin1 {
return Ok(USVString(jsstring_to_str(cx, jsstr).0));
// FIXME(ajeffrey): Convert directly from DOMString to USVString
return Ok(USVString(String::from(jsstring_to_str(cx, jsstr))));
}
let mut length = 0;
let chars = JS_GetTwoByteStringCharsAndLength(cx, ptr::null(), jsstr, &mut length);