LibJS: Make Value::as_object() return Object&

Let's move towards using references over pointers in LibJS as well.
I had originally steered away from it because that's how I've seen
things done in other engines. But this is not the other engines. :^)
This commit is contained in:
Andreas Kling 2020-04-01 22:18:47 +02:00
commit 1549c5c48b
Notes: sideshowbarker 2024-07-19 08:00:24 +09:00
8 changed files with 54 additions and 54 deletions

View file

@ -92,7 +92,7 @@ Value ObjectConstructor::set_prototype_of(Interpreter& interpreter)
auto* object = interpreter.call_frame().arguments[0].to_object(interpreter.heap());
if (interpreter.exception())
return {};
object->set_prototype(const_cast<Object*>(interpreter.call_frame().arguments[1].as_object()));
object->set_prototype(&const_cast<Object&>(interpreter.call_frame().arguments[1].as_object()));
return {};
}