Skip to content

Commit

Permalink
LibWeb: Push the realm execution context before linking modules
Browse files Browse the repository at this point in the history
This patch adds a non standard step pushing the realm execution context
of fetching client's settings object onto the execution context stack
before linking a module script. Without the realm execution context
there is no current settings object, leading to a crash in
HostResolveImportedModule.
  • Loading branch information
networkException committed Oct 4, 2022
1 parent 7e21d64 commit 9057031
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Userland/Libraries/LibWeb/HTML/Scripting/Fetching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ void fetch_inline_module_script_graph(String const& filename, String const& sour
// https://html.spec.whatwg.org/multipage/webappapis.html#fetch-the-descendants-of-and-link-a-module-script
void fetch_descendants_of_and_link_a_module_script(JavaScriptModuleScript const& module_script, EnvironmentSettingsObject& fetch_client_settings_object, StringView destination, HashTable<ModuleLocationTuple> const& visited_set, ModuleCallback on_complete)
{
fetch_client_settings_object.realm().vm().push_execution_context(fetch_client_settings_object.realm_execution_context());

// 1. Fetch the descendants of module script, given fetch client settings object, destination, visited set, and onFetchDescendantsComplete as defined below.
// If performFetch was given, pass it along as well.
// FIXME: Pass performFetch if given.
Expand Down

0 comments on commit 9057031

Please sign in to comment.