summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/EventLoop
diff options
context:
space:
mode:
authorLuke Wilde <lukew@serenityos.org>2022-02-06 03:32:26 +0000
committerLinus Groh <mail@linusgroh.de>2022-02-08 17:47:44 +0000
commit17aeb99e9e92bd8bb47e9680385d9325f3321109 (patch)
treec2dc1052894a620884cc6c5d501985f242420344 /Userland/Libraries/LibWeb/HTML/EventLoop
parent4c1c6ef91c5339cced845ea63da4dc937e7ffb0e (diff)
downloadserenity-17aeb99e9e92bd8bb47e9680385d9325f3321109.zip
LibWeb: Implement the JS host hooks for promises, job callbacks and more
This overrides the JS host hooks to follow the spec for queuing promises, making/calling job callbacks, unhandled promise rejection handling and FinalizationRegistry queuing. This also allows us to drop the on_call_stack_emptied hook in Document::interpreter().
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/EventLoop')
-rw-r--r--Userland/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp3
-rw-r--r--Userland/Libraries/LibWeb/HTML/EventLoop/Task.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp b/Userland/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp
index b4d8e57c78..259e7b4240 100644
--- a/Userland/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp
+++ b/Userland/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp
@@ -284,7 +284,8 @@ void EventLoop::perform_a_microtask_checkpoint()
// FIXME: 5. Cleanup Indexed Database transactions.
- // FIXME: 6. Perform ClearKeptObjects().
+ // 6. Perform ClearKeptObjects().
+ vm().finish_execution_generation();
// 7. Set the event loop's performing a microtask checkpoint to false.
m_performing_a_microtask_checkpoint = false;
diff --git a/Userland/Libraries/LibWeb/HTML/EventLoop/Task.h b/Userland/Libraries/LibWeb/HTML/EventLoop/Task.h
index 51947f58d3..22aaa8c10a 100644
--- a/Userland/Libraries/LibWeb/HTML/EventLoop/Task.h
+++ b/Userland/Libraries/LibWeb/HTML/EventLoop/Task.h
@@ -26,6 +26,7 @@ public:
PostedMessage,
Microtask,
TimerTask,
+ JavaScriptEngine,
};
static NonnullOwnPtr<Task> create(Source source, DOM::Document* document, Function<void()> steps)