diff --git a/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp b/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp index af711d4c831..8ce8c2936d4 100644 --- a/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp +++ b/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp @@ -473,6 +473,10 @@ void perform_a_microtask_checkpoint() // https://html.spec.whatwg.org/#perform-a-microtask-checkpoint void EventLoop::perform_a_microtask_checkpoint() { + // NOTE: This assertion is per requirement 9.5 of the ECMA-262 spec, see: https://tc39.es/ecma262/#sec-jobs + // > At some future point in time, when there is no running context in the agent for which the job is scheduled and that agent's execution context stack is empty... + VERIFY(vm().execution_context_stack().is_empty()); + // 1. If the event loop's performing a microtask checkpoint is true, then return. if (m_performing_a_microtask_checkpoint) return;