LibWeb: Update workarounds for the empty execution context stack

Use the new helper class to perform this workaround.
This commit is contained in:
Timothy Flynn 2023-07-06 07:43:23 -04:00 committed by Tim Flynn
parent 8ec7b4401a
commit f57310999d
Notes: sideshowbarker 2024-07-17 21:26:19 +09:00
7 changed files with 30 additions and 88 deletions

View file

@ -19,6 +19,7 @@
#include <LibWeb/HTML/Scripting/Environments.h>
#include <LibWeb/HTML/Scripting/Fetching.h>
#include <LibWeb/HTML/Scripting/ModuleScript.h>
#include <LibWeb/HTML/Scripting/TemporaryExecutionContext.h>
#include <LibWeb/HTML/Window.h>
#include <LibWeb/Infra/Strings.h>
#include <LibWeb/Loader/LoadRequest.h>
@ -568,9 +569,7 @@ void fetch_descendants_of_and_link_a_module_script(JavaScriptModuleScript& modul
return;
}
// FIXME: This is an ad-hoc hack to make sure that there's an execution context on the VM stack in case linking throws an exception.
auto& vm = fetch_client_settings_object.vm();
vm.push_execution_context(fetch_client_settings_object.realm_execution_context());
TemporaryExecutionContext execution_context { fetch_client_settings_object };
// FIXME: 2. Let parse error be the result of finding the first parse error given result.
@ -591,9 +590,6 @@ void fetch_descendants_of_and_link_a_module_script(JavaScriptModuleScript& modul
TODO();
}
// FIXME: This undoes the ad-hoc hack above.
vm.pop_execution_context();
// 5. Run onComplete given result.
on_complete(result);
});