diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-06-30 18:13:51 +0300 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-06-30 18:41:32 +0100 |
commit | c254e4cf10264cefe805578b14f2e4deaf286f56 (patch) | |
tree | a92d5d7d3bb104f7a7840eff1e5ee6091e2ea977 /Userland/Libraries/LibJS/Runtime/StringObject.cpp | |
parent | 5606332ed72e60fa720cf17ad055cca8d2d36b05 (diff) | |
download | serenity-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.cpp | 5 |
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) |