LibJS: Pass prototype to StringObject constructor

This commit is contained in:
Andreas Kling 2020-04-17 19:01:31 +02:00
commit 298c606200
Notes: sideshowbarker 2024-07-19 07:31:41 +09:00
5 changed files with 23 additions and 12 deletions

View file

@ -113,7 +113,7 @@ Object* Value::to_object(Heap& heap) const
return &const_cast<Object&>(as_object());
if (is_string())
return heap.allocate<StringObject>(m_value.as_string);
return StringObject::create(heap.interpreter().global_object(), *m_value.as_string);
if (is_number())
return NumberObject::create(heap.interpreter().global_object(), m_value.as_double);