1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 21:58:10 +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

@ -71,7 +71,7 @@ Value StringConstructor::construct(Interpreter& interpreter)
Value StringConstructor::raw(Interpreter& interpreter)
{
auto* template_object = interpreter.argument(0).to_object(interpreter.heap());
auto* template_object = interpreter.argument(0).to_object(interpreter);
if (interpreter.exception())
return {};
@ -83,7 +83,7 @@ Value StringConstructor::raw(Interpreter& interpreter)
if (!raw.is_array())
return js_string(interpreter, "");
auto& raw_array_elements = static_cast<Array*>(raw.to_object(interpreter.heap()))->elements();
auto& raw_array_elements = static_cast<Array*>(raw.to_object(interpreter))->elements();
StringBuilder builder;
for (size_t i = 0; i < raw_array_elements.size(); ++i) {