aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/fetch.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/fetch.rs')
-rw-r--r--components/script/fetch.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/components/script/fetch.rs b/components/script/fetch.rs
index 9fe0932eab4..47be4ced130 100644
--- a/components/script/fetch.rs
+++ b/components/script/fetch.rs
@@ -77,7 +77,7 @@ pub fn Fetch(global: &GlobalScope, input: RequestInfo, init: RootedTraceableBox<
// Step 2
let request = match Request::Constructor(global, input, init) {
Err(e) => {
- promise.reject_error(promise.global().get_cx(), e);
+ promise.reject_error(e);
return promise;
},
Ok(r) => r.get_request(),
@@ -135,9 +135,7 @@ impl FetchResponseListener for FetchContext {
match fetch_metadata {
// Step 4.1
Err(_) => {
- promise.reject_error(
- promise.global().get_cx(),
- Error::Type("Network error occurred".to_string()));
+ promise.reject_error(Error::Type("Network error occurred".to_string()));
self.fetch_promise = Some(TrustedPromise::new(promise));
self.response_object.root().set_type(DOMResponseType::Error);
return;