Stringifier is sno longer exposed

This commit is contained in:
Patrick Shaughnessy 2019-12-12 16:18:21 -05:00
parent a5c368fd01
commit 981d13dcfc
4 changed files with 6 additions and 26 deletions

View file

@ -6,7 +6,6 @@
#[cfg(feature = "js_backtrace")]
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::DOMExceptionBinding::DOMExceptionMethods;
use crate::dom::bindings::codegen::PrototypeList::proto_id_to_name;
use crate::dom::bindings::conversions::root_from_object;
use crate::dom::bindings::conversions::{
@ -221,7 +220,7 @@ impl ErrorInfo {
Some(ErrorInfo {
filename: "".to_string(),
message: exception.Stringifier().into(),
message: exception.stringifier().into(),
lineno: 0,
column: 0,
})

View file

@ -149,6 +149,11 @@ impl DOMException {
DOMExceptionBinding::Wrap,
))
}
// not an IDL stringifier, used internally
pub fn stringifier(&self) -> DOMString {
DOMString::from(format!("{}: {}", self.name, self.message))
}
}
impl DOMExceptionMethods for DOMException {
@ -169,9 +174,4 @@ impl DOMExceptionMethods for DOMException {
fn Message(&self) -> DOMString {
self.message.clone()
}
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-error.prototype.tostring
fn Stringifier(&self) -> DOMString {
DOMString::from(format!("{}: {}", self.name, self.message))
}
}

View file

@ -47,6 +47,4 @@ interface DOMException {
// A custom message set by the thrower.
readonly attribute DOMString message;
stringifier;
};