1
Fork 0
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:
Andreas Kling 2020-04-17 18:55:53 +02:00
parent 2d7b495244
commit cf702a13b9
5 changed files with 15 additions and 7 deletions

View file

@ -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);