summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Runtime/Value.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-04-17 19:01:31 +0200
committerAndreas Kling <kling@serenityos.org>2020-04-18 10:28:22 +0200
commit298c6062000754333f360c4e80368680a1da90e8 (patch)
tree7d4a365c1cfd1f73417e286e791ade608fa595b5 /Libraries/LibJS/Runtime/Value.cpp
parentcf702a13b9c8a380923929519ce035233b1e4080 (diff)
downloadserenity-298c6062000754333f360c4e80368680a1da90e8.zip
LibJS: Pass prototype to StringObject constructor
Diffstat (limited to 'Libraries/LibJS/Runtime/Value.cpp')
-rw-r--r--Libraries/LibJS/Runtime/Value.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibJS/Runtime/Value.cpp b/Libraries/LibJS/Runtime/Value.cpp
index cd400082ff..a5a6adba49 100644
--- a/Libraries/LibJS/Runtime/Value.cpp
+++ b/Libraries/LibJS/Runtime/Value.cpp
@@ -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);