mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:37:35 +00:00
LibJS: Setup host hooks and have promise jobs work out the realm
This allows the host of LibJS (notably LibWeb in this case) to override certain functions such as HostEnqueuePromiseJob, so it can do it's own thing in certain situations. Notably, LibWeb will override HostEnqueuePromiseJob to put promise jobs on the microtask queue. This also makes promise jobs use AK::Function instead of JS::NativeFunction. This removes the need to go through a JavaScript function and it more closely matches the spec's idea of "abstract closures"
This commit is contained in:
parent
5aacec65ab
commit
4c1c6ef91c
12 changed files with 202 additions and 172 deletions
|
@ -93,10 +93,6 @@ void PromiseReaction::visit_edges(Cell::Visitor& visitor)
|
|||
visitor.visit(capability.resolve);
|
||||
visitor.visit(capability.reject);
|
||||
}
|
||||
if (m_handler.has_value()) {
|
||||
auto& handler = m_handler.value();
|
||||
visitor.visit(handler.callback);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue