mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibWeb: Don't assume a Window global object in HostEnqueuePromiseJob
This was causing crashes in Worker test cases making use of promises,
fixing a regression introduced in
da18551f10
This commit is contained in:
parent
c4e8eeb9a3
commit
371ddf9dc3
Notes:
github-actions[bot]
2024-11-02 09:42:55 +00:00
Author: https://github.com/shannonbooth Commit: https://github.com/LadybirdBrowser/ladybird/commit/371ddf9dc37 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2118 Reviewed-by: https://github.com/tcl3 ✅
1 changed files with 1 additions and 1 deletions
|
@ -279,7 +279,7 @@ ErrorOr<void> initialize_main_thread_vm(HTML::EventLoop::Type type)
|
|||
auto* script = active_script();
|
||||
|
||||
auto& heap = realm ? realm->heap() : vm.heap();
|
||||
HTML::queue_a_microtask(script ? &verify_cast<HTML::Window>(script->realm().global_object()).associated_document() : nullptr, JS::create_heap_function(heap, [&vm, realm, job = move(job), script_or_module = move(script_or_module)] {
|
||||
HTML::queue_a_microtask(script ? script->settings_object().responsible_document().ptr() : nullptr, JS::create_heap_function(heap, [&vm, realm, job = move(job), script_or_module = move(script_or_module)] {
|
||||
// The dummy execution context has to be kept up here to keep it alive for the duration of the function.
|
||||
OwnPtr<JS::ExecutionContext> dummy_execution_context;
|
||||
|
||||
|
|
Loading…
Reference in a new issue