ladybird/Libraries/LibWeb/HTML/EventLoop
Timothy Flynn 43dc0f52a6 LibWeb: Do not run microtasks when the event loop is paused
For example, running `alert(1)` will pause the event loop, during which
time no JavaScript should execute. This patch extends this disruption to
microtasks. This avoids a crash inside the microtask executor, which
asserts the JS execution context stack is empty.

This makes us behave the same as Firefox in the following page:

    <script>
        queueMicrotask(() => {
            console.log("inside microtask");
        });

        alert("hi");
    </script>

Before the aforementioned assertion was added, we would execute that
microtask before showing the alert. Firefox does not do this, and now
we don't either.
2025-01-19 20:47:50 +00:00
..
EventLoop.cpp LibWeb: Do not run microtasks when the event loop is paused 2025-01-19 20:47:50 +00:00
EventLoop.h LibWeb: Remove EventLoop::documents_in_this_event_loop() 2024-11-24 19:28:13 +00:00
Task.cpp LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
Task.h LibWeb: Add WebSocket task source 2024-11-15 23:18:10 +01:00
TaskQueue.cpp LibGC: Rename MarkedVector => RootVector 2024-12-26 19:10:44 +01:00
TaskQueue.h LibGC: Rename MarkedVector => RootVector 2024-12-26 19:10:44 +01:00