1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 06:57:35 +00:00

LibJS: Change Value::to_object(Heap& -> Interpreter&)

Passing a Heap& to it only to then call interpreter() on that is weird.
Let's just give it the Interpreter& directly, like some of the other
to_something() functions.
This commit is contained in:
Linus Groh 2020-05-17 21:38:47 +01:00 committed by Andreas Kling
parent b8b7f84547
commit 1a1394f7a2
26 changed files with 56 additions and 57 deletions

View file

@ -80,7 +80,7 @@ void WindowObject::visit_children(Visitor& visitor)
static Window* impl_from(JS::Interpreter& interpreter)
{
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
auto* this_object = interpreter.this_value().to_object(interpreter);
if (!this_object) {
ASSERT_NOT_REACHED();
return nullptr;
@ -129,7 +129,7 @@ JS::Value WindowObject::set_interval(JS::Interpreter& interpreter)
auto& arguments = interpreter.call_frame().arguments;
if (arguments.size() < 2)
return {};
auto* callback_object = arguments[0].to_object(interpreter.heap());
auto* callback_object = arguments[0].to_object(interpreter);
if (!callback_object)
return {};
if (!callback_object->is_function())
@ -146,7 +146,7 @@ JS::Value WindowObject::set_timeout(JS::Interpreter& interpreter)
auto& arguments = interpreter.call_frame().arguments;
if (arguments.size() < 1)
return {};
auto* callback_object = arguments[0].to_object(interpreter.heap());
auto* callback_object = arguments[0].to_object(interpreter);
if (!callback_object)
return {};
if (!callback_object->is_function())
@ -168,7 +168,7 @@ JS::Value WindowObject::request_animation_frame(JS::Interpreter& interpreter)
auto& arguments = interpreter.call_frame().arguments;
if (arguments.size() < 1)
return {};
auto* callback_object = arguments[0].to_object(interpreter.heap());
auto* callback_object = arguments[0].to_object(interpreter);
if (!callback_object)
return {};
if (!callback_object->is_function())