1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:17:44 +00:00

LibJS: Add the FinalizationRegistry built-in object

As well as the needed functionality in VM to enqueue and run cleanup
jobs for the FinalizationRegistry instances.
This commit is contained in:
Idan Horowitz 2021-06-15 22:16:17 +03:00 committed by Linus Groh
parent 8c7fe8d6c8
commit de9fa6622a
14 changed files with 365 additions and 20 deletions

View file

@ -630,6 +630,7 @@ JS::Interpreter& Document::interpreter()
vm.on_call_stack_emptied = [this] {
auto& vm = m_interpreter->vm();
vm.run_queued_promise_jobs();
vm.run_queued_finalization_registry_cleanup_jobs();
// Note: This is not an exception check for the promise jobs, they will just leave any
// exception that already exists intact and never throw a new one (without cleaning it
// up, that is). Taking care of any previous unhandled exception just happens to be the