LibJS: Pass prototype to NumberObject constructor

This commit is contained in:
Andreas Kling 2020-04-17 18:55:53 +02:00
commit cf702a13b9
Notes: sideshowbarker 2024-07-19 07:31:43 +09:00
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);