mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:48:11 +00:00
LibJS: Pass prototype to NumberObject constructor
This commit is contained in:
parent
2d7b495244
commit
cf702a13b9
5 changed files with 15 additions and 7 deletions
|
@ -116,7 +116,7 @@ Object* Value::to_object(Heap& heap) const
|
|||
return heap.allocate<StringObject>(m_value.as_string);
|
||||
|
||||
if (is_number())
|
||||
return heap.allocate<NumberObject>(m_value.as_double);
|
||||
return NumberObject::create(heap.interpreter().global_object(), m_value.as_double);
|
||||
|
||||
if (is_boolean())
|
||||
return heap.allocate<BooleanObject>(m_value.as_bool);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue