1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:47:46 +00:00

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
parent b995a499d3
commit 1549c5c48b
8 changed files with 54 additions and 54 deletions

View file

@ -109,16 +109,16 @@ public:
return m_value.as_bool;
}
Object* as_object()
Object& as_object()
{
ASSERT(type() == Type::Object);
return m_value.as_object;
return *m_value.as_object;
}
const Object* as_object() const
const Object& as_object() const
{
ASSERT(type() == Type::Object);
return m_value.as_object;
return *m_value.as_object;
}
PrimitiveString* as_string()