mirror of
https://github.com/servo/servo.git
synced 2025-08-01 19:50:30 +01:00
Add better stringifier for DOMException
This commit is contained in:
parent
b677f0f4ae
commit
982e55ac1c
2 changed files with 7 additions and 0 deletions
|
@ -104,4 +104,9 @@ impl DOMExceptionMethods for DOMException {
|
||||||
|
|
||||||
message.to_owned()
|
message.to_owned()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-error.prototype.tostring
|
||||||
|
fn Stringifier(&self) -> String {
|
||||||
|
format!("{}: {}", self.Name(), self.Message())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,4 +44,6 @@ interface DOMException {
|
||||||
|
|
||||||
// A custom message set by the thrower.
|
// A custom message set by the thrower.
|
||||||
readonly attribute DOMString message;
|
readonly attribute DOMString message;
|
||||||
|
|
||||||
|
stringifier;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue