summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/StringObject.cpp
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-06-30 18:13:51 +0300
committerLinus Groh <mail@linusgroh.de>2021-06-30 18:41:32 +0100
commitc254e4cf10264cefe805578b14f2e4deaf286f56 (patch)
treea92d5d7d3bb104f7a7840eff1e5ee6091e2ea977 /Userland/Libraries/LibJS/Runtime/StringObject.cpp
parent5606332ed72e60fa720cf17ad055cca8d2d36b05 (diff)
downloadserenity-c254e4cf10264cefe805578b14f2e4deaf286f56.zip
LibJS: Get the prototype of a new String from the constructor's realm
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/StringObject.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/StringObject.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/StringObject.cpp b/Userland/Libraries/LibJS/Runtime/StringObject.cpp
index b23015ef12..cef42a85d6 100644
--- a/Userland/Libraries/LibJS/Runtime/StringObject.cpp
+++ b/Userland/Libraries/LibJS/Runtime/StringObject.cpp
@@ -11,9 +11,10 @@
namespace JS {
-StringObject* StringObject::create(GlobalObject& global_object, PrimitiveString& primitive_string)
+// 10.4.3.4 StringCreate ( value, prototype ), https://tc39.es/ecma262/#sec-stringcreate
+StringObject* StringObject::create(GlobalObject& global_object, PrimitiveString& primitive_string, Object& prototype)
{
- return global_object.heap().allocate<StringObject>(global_object, primitive_string, *global_object.string_prototype());
+ return global_object.heap().allocate<StringObject>(global_object, primitive_string, prototype);
}
StringObject::StringObject(PrimitiveString& string, Object& prototype)