Use DOMString::new() somewhat consistently.

This commit is contained in:
Ms2ger 2015-11-03 14:11:07 +01:00
parent dab3926622
commit e6aa976462
24 changed files with 67 additions and 68 deletions

View file

@ -56,7 +56,6 @@ use js::rust::{ToInt64, ToUint64};
use libc;
use num::Float;
use num::traits::{Bounded, Zero};
use std::borrow::ToOwned;
use std::rc::Rc;
use std::{char, ptr, slice};
use util::str::DOMString;
@ -517,7 +516,7 @@ impl FromJSValConvertible for DOMString {
-> Result<DOMString, ()> {
if null_behavior == StringificationBehavior::Empty &&
value.get().is_null() {
Ok("".to_owned())
Ok(DOMString::new())
} else {
let jsstr = unsafe { ToString(cx, value) };
if jsstr.is_null() {