aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/domexception.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/domexception.rs')
-rw-r--r--components/script/dom/domexception.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/components/script/dom/domexception.rs b/components/script/dom/domexception.rs
index 0af98e21e81..48f8e4b52f6 100644
--- a/components/script/dom/domexception.rs
+++ b/components/script/dom/domexception.rs
@@ -11,8 +11,10 @@ use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::utils::{Reflector, reflect_dom_object};
use servo_util::str::DOMString;
+use std::borrow::ToOwned;
+
#[repr(uint)]
-#[deriving(Copy, Show)]
+#[derive(Copy, Show)]
#[jstraceable]
pub enum DOMErrorName {
IndexSizeError = DOMExceptionConstants::INDEX_SIZE_ERR as uint,
@@ -96,7 +98,7 @@ impl<'a> DOMExceptionMethods for JSRef<'a, DOMException> {
// http://dom.spec.whatwg.org/#error-names-0
fn Name(self) -> DOMString {
- self.code.to_string()
+ format!("{:?}", self.code)
}
// http://dom.spec.whatwg.org/#error-names-0
@@ -125,6 +127,6 @@ impl<'a> DOMExceptionMethods for JSRef<'a, DOMException> {
DOMErrorName::EncodingError => "The encoding operation (either encoded or decoding) failed."
};
- message.into_string()
+ message.to_owned()
}
}