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

LibWeb: Make wrapper factory functions take JS::GlobalObject&

Instead of taking the JS::Heap&. This allows us to get rid of some
calls to JS::Interpreter::global_object(). We're getting closer and
closer to multiple global objects. :^)
This commit is contained in:
Andreas Kling 2020-06-23 16:57:39 +02:00
parent c24f5585b2
commit fc4ed8d444
12 changed files with 33 additions and 36 deletions

View file

@ -94,10 +94,10 @@ void XMLHttpRequest::dispatch_event(NonnullRefPtr<Event> event)
for (auto& listener : listeners()) {
if (listener.event_name == event->type()) {
auto& function = const_cast<EventListener&>(*listener.listener).function();
auto& heap = function.heap();
auto* this_value = wrap(heap, *this);
JS::MarkedValueList arguments(heap);
arguments.append(wrap(heap, *event));
auto& global_object = function.global_object();
auto* this_value = wrap(global_object, *this);
JS::MarkedValueList arguments(global_object.heap());
arguments.append(wrap(global_object, *event));
function.interpreter().call(function, this_value, move(arguments));
}
}