aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/domexception.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2018-09-19 17:47:27 -0400
committerGitHub <noreply@github.com>2018-09-19 17:47:27 -0400
commitdf2adebefdfa3da49f173e480fa1e56450f9bda2 (patch)
tree1f05b49bac02318455a59d5b143c186fd872bdb9 /components/script/dom/domexception.rs
parent2ca7a134736bb4759ff209c1bc0b6dc3cc1984c9 (diff)
parentc37a345dc9f4dda6ea29c42f96f6c7201c42cbac (diff)
downloadservo-df2adebefdfa3da49f173e480fa1e56450f9bda2.tar.gz
servo-df2adebefdfa3da49f173e480fa1e56450f9bda2.zip
Auto merge of #21737 - chansuke:format_script, r=jdm
Format script component --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix part of #21373. - [x] These changes do not require tests because they format code only. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21737) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/domexception.rs')
-rw-r--r--components/script/dom/domexception.rs23
1 files changed, 15 insertions, 8 deletions
diff --git a/components/script/dom/domexception.rs b/components/script/dom/domexception.rs
index 4f2c076ec66..92debdc825e 100644
--- a/components/script/dom/domexception.rs
+++ b/components/script/dom/domexception.rs
@@ -53,9 +53,11 @@ impl DOMException {
}
pub fn new(global: &GlobalScope, code: DOMErrorName) -> DomRoot<DOMException> {
- reflect_dom_object(Box::new(DOMException::new_inherited(code)),
- global,
- DOMExceptionBinding::Wrap)
+ reflect_dom_object(
+ Box::new(DOMException::new_inherited(code)),
+ global,
+ DOMExceptionBinding::Wrap,
+ )
}
}
@@ -74,7 +76,9 @@ impl DOMExceptionMethods for DOMException {
fn Message(&self) -> DOMString {
let message = match self.code {
DOMErrorName::IndexSizeError => "The index is not in the allowed range.",
- DOMErrorName::HierarchyRequestError => "The operation would yield an incorrect node tree.",
+ DOMErrorName::HierarchyRequestError => {
+ "The operation would yield an incorrect node tree."
+ },
DOMErrorName::WrongDocumentError => "The object is in the wrong document.",
DOMErrorName::InvalidCharacterError => "The string contains invalid characters.",
DOMErrorName::NoModificationAllowedError => "The object can not be modified.",
@@ -85,17 +89,20 @@ impl DOMExceptionMethods for DOMException {
DOMErrorName::SyntaxError => "The string did not match the expected pattern.",
DOMErrorName::InvalidModificationError => "The object can not be modified in this way.",
DOMErrorName::NamespaceError => "The operation is not allowed by Namespaces in XML.",
- DOMErrorName::InvalidAccessError => "The object does not support the operation or argument.",
+ DOMErrorName::InvalidAccessError => {
+ "The object does not support the operation or argument."
+ },
DOMErrorName::SecurityError => "The operation is insecure.",
DOMErrorName::NetworkError => "A network error occurred.",
DOMErrorName::AbortError => "The operation was aborted.",
DOMErrorName::TypeMismatchError => "The given type does not match any expected type.",
DOMErrorName::QuotaExceededError => "The quota has been exceeded.",
DOMErrorName::TimeoutError => "The operation timed out.",
- DOMErrorName::InvalidNodeTypeError =>
- "The supplied node is incorrect or has an incorrect ancestor for this operation.",
+ DOMErrorName::InvalidNodeTypeError => {
+ "The supplied node is incorrect or has an incorrect ancestor for this operation."
+ },
DOMErrorName::DataCloneError => "The object can not be cloned.",
- DOMErrorName::NotReadableError => "The I/O read operation failed."
+ DOMErrorName::NotReadableError => "The I/O read operation failed.",
};
DOMString::from(message)