1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 09:07:44 +00:00

LibJS: Pass prototype to StringObject constructor

This commit is contained in:
Andreas Kling 2020-04-17 19:01:31 +02:00
parent cf702a13b9
commit 298c606200
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);