diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index e1cbbd0256f..9d4e1d4e361 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -1342,7 +1342,7 @@ impl WindowMethods for Window { init: RootedTraceableBox, comp: InRealm, ) -> Rc { - fetch::Fetch(self.upcast(), input, init, comp) + fetch::Fetch(self.upcast(), input, init, comp, CanGc::note()) } fn TestRunner(&self) -> DomRoot { diff --git a/components/script/dom/workerglobalscope.rs b/components/script/dom/workerglobalscope.rs index f328e0a127c..91d21feb945 100644 --- a/components/script/dom/workerglobalscope.rs +++ b/components/script/dom/workerglobalscope.rs @@ -55,7 +55,7 @@ use crate::dom::workernavigator::WorkerNavigator; use crate::fetch; use crate::realms::{enter_realm, InRealm}; use crate::script_runtime::{ - get_reports, CommonScriptMsg, JSContext, Runtime, ScriptChan, ScriptPort, + get_reports, CanGc, CommonScriptMsg, JSContext, Runtime, ScriptChan, ScriptPort, }; use crate::task::TaskCanceller; use crate::task_source::dom_manipulation::DOMManipulationTaskSource; @@ -406,7 +406,7 @@ impl WorkerGlobalScopeMethods for WorkerGlobalScope { init: RootedTraceableBox, comp: InRealm, ) -> Rc { - fetch::Fetch(self.upcast(), input, init, comp) + fetch::Fetch(self.upcast(), input, init, comp, CanGc::note()) } // https://w3c.github.io/hr-time/#the-performance-attribute diff --git a/components/script/fetch.rs b/components/script/fetch.rs index d39dafe5e80..334805ec471 100644 --- a/components/script/fetch.rs +++ b/components/script/fetch.rs @@ -145,6 +145,7 @@ pub fn Fetch( input: RequestInfo, init: RootedTraceableBox, comp: InRealm, + can_gc: CanGc, ) -> Rc { let core_resource_thread = global.core_resource_thread(); @@ -158,7 +159,7 @@ pub fn Fetch( // Step 2. Let requestObject be the result of invoking the initial value of Request as constructor // with input and init as arguments. If this throws an exception, reject p with it and return p. - let request = match Request::Constructor(global, None, CanGc::note(), input, init) { + let request = match Request::Constructor(global, None, can_gc, input, init) { Err(e) => { response.error_stream(e.clone()); promise.reject_error(e);