mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +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:
parent
b995a499d3
commit
1549c5c48b
8 changed files with 54 additions and 54 deletions
|
@ -47,10 +47,10 @@ DateConstructor::~DateConstructor()
|
|||
|
||||
Value DateConstructor::call(Interpreter& interpreter)
|
||||
{
|
||||
auto* date = static_cast<Date*>(construct(interpreter).as_object());
|
||||
if (!date)
|
||||
auto date = construct(interpreter);
|
||||
if (!date.is_object())
|
||||
return {};
|
||||
return js_string(interpreter.heap(), date->string());
|
||||
return js_string(interpreter.heap(), static_cast<Date&>(date.as_object()).string());
|
||||
}
|
||||
|
||||
Value DateConstructor::construct(Interpreter& interpreter)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue