Skip to content

Commit

Permalink
update fetch_descendants_of_a_module_script to match spec update
Browse files Browse the repository at this point in the history
  • Loading branch information
networkException committed Sep 21, 2022
1 parent a7bb141 commit 0244a5b
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions Userland/Libraries/LibWeb/HTML/Scripting/Fetching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,21 @@ void fetch_descendants_of_a_module_script(JavaScriptModuleScript const& module_s

// FIXME: 7. Assert: options is not null, as module script is a JavaScript module script.

if (module_requests.is_empty()) {
// 8. Let pendingCount be the length of moduleRequests.
auto pending_count = module_requests.size();

// 9. If pendingCount is zero, run onComplete with module script.
if (pending_count == 0) {
on_complete(&module_script);
return;
}

// 10. Let failed be false.
auto context = DescendantFetchingContext::create();

// 8. Let pendingCount be the length of moduleRequests.
context->set_pending_count(module_requests.size());

// 9. Let failed be false.
context->set_pending_count(pending_count);
context->set_failed(false);

context->set_on_complete(move(on_complete));

// VERIFY(module_requests.size() > 0);

// 10. For each moduleRequest in moduleRequests, perform the internal module script graph fetching procedure given moduleRequest,
// fetch client settings object, destination, options, module script's settings object, visited set, module script's base URL, and the following steps given result:
for (auto const& module_request : module_requests) {
Expand Down

0 comments on commit 0244a5b

Please sign in to comment.