mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb/HTML: Assert microtasks invoked on empty execution context stack
This a requirement from the ECMA-262 spec.
This commit is contained in:
parent
ee1b2dced3
commit
34b8a9ab75
Notes:
github-actions[bot]
2025-01-03 10:00:13 +00:00
Author: https://github.com/shannonbooth
Commit: 34b8a9ab75
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3109
1 changed files with 4 additions and 0 deletions
|
@ -473,6 +473,10 @@ void perform_a_microtask_checkpoint()
|
||||||
// https://html.spec.whatwg.org/#perform-a-microtask-checkpoint
|
// https://html.spec.whatwg.org/#perform-a-microtask-checkpoint
|
||||||
void EventLoop::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.
|
// 1. If the event loop's performing a microtask checkpoint is true, then return.
|
||||||
if (m_performing_a_microtask_checkpoint)
|
if (m_performing_a_microtask_checkpoint)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue