From 681e4e5d01a239fe636c1eabdf3a891d06383c9b Mon Sep 17 00:00:00 2001 From: Kenneth Myhra Date: Wed, 6 Aug 2025 20:18:18 +0200 Subject: [PATCH] LibWeb: Define stream variable before using it This is an editoral change from the fetch spec. Since we already defined the stream before it being used this only re-numbers the spec steps. It also corrects a minor typo ('followings' to 'following') which was corrected in the same editoral spec change. --- Libraries/LibWeb/Fetch/Fetching/Fetching.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp b/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp index b270aab9b27..74017a87999 100644 --- a/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp +++ b/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp @@ -2325,11 +2325,11 @@ WebIDL::ExceptionOr> nonstandard_resource_loader_file_o if (request->buffer_policy() == Infrastructure::Request::BufferPolicy::DoNotBufferResponse) { HTML::TemporaryExecutionContext execution_context { realm, HTML::TemporaryExecutionContext::CallbacksEnabled::Yes }; - // 12. Let stream be a new ReadableStream. + // 10. Let stream be a new ReadableStream. auto stream = realm.create(realm); auto fetched_data_receiver = realm.create(fetch_params, stream); - // 10. Let pullAlgorithm be the followings steps: + // 11. Let pullAlgorithm be the following steps: auto pull_algorithm = GC::create_function(realm.heap(), [&realm, fetched_data_receiver]() { // 1. Let promise be a new promise. auto promise = WebIDL::create_promise(realm); @@ -2342,7 +2342,7 @@ WebIDL::ExceptionOr> nonstandard_resource_loader_file_o return promise; }); - // 11. Let cancelAlgorithm be an algorithm that aborts fetchParams’s controller with reason, given reason. + // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s controller with reason, given reason. auto cancel_algorithm = GC::create_function(realm.heap(), [&realm, &fetch_params](JS::Value reason) { fetch_params.controller()->abort(realm, reason); return WebIDL::create_resolved_promise(realm, JS::js_undefined());