mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibWeb: Set a TemporaryExecutionContext when finishing module loads
I'm not entirely sure why this is needed, but it's the same ol' workaround we're using in a bazillion places where we get caught trying to do JavaScripty things without a running execution context.
This commit is contained in:
parent
58294db294
commit
62361e40a1
Notes:
sideshowbarker
2024-07-17 11:06:06 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/62361e40a1 Pull-request: https://github.com/SerenityOS/serenity/pull/21967 Issue: https://github.com/SerenityOS/serenity/issues/21737 Issue: https://github.com/SerenityOS/serenity/issues/21899
1 changed files with 3 additions and 0 deletions
|
@ -35,6 +35,7 @@
|
|||
#include <LibWeb/HTML/Scripting/Fetching.h>
|
||||
#include <LibWeb/HTML/Scripting/ModuleScript.h>
|
||||
#include <LibWeb/HTML/Scripting/Script.h>
|
||||
#include <LibWeb/HTML/Scripting/TemporaryExecutionContext.h>
|
||||
#include <LibWeb/HTML/TagNames.h>
|
||||
#include <LibWeb/HTML/Window.h>
|
||||
#include <LibWeb/HTML/WindowProxy.h>
|
||||
|
@ -450,6 +451,7 @@ ErrorOr<void> initialize_main_thread_vm()
|
|||
auto completion = dom_exception_to_throw_completion(main_thread_vm(), url.exception());
|
||||
|
||||
// 2. Perform FinishLoadingImportedModule(referrer, moduleRequest, payload, completion).
|
||||
HTML::TemporaryExecutionContext context { host_defined_environment_settings_object(realm) };
|
||||
JS::finish_loading_imported_module(referrer, module_request, payload, completion);
|
||||
|
||||
// 3. Return.
|
||||
|
@ -508,6 +510,7 @@ ErrorOr<void> initialize_main_thread_vm()
|
|||
}();
|
||||
|
||||
// 5. Perform FinishLoadingImportedModule(referrer, moduleRequest, payload, completion).
|
||||
HTML::TemporaryExecutionContext context { host_defined_environment_settings_object(realm) };
|
||||
JS::finish_loading_imported_module(referrer, module_request, payload, completion);
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue