summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-06-17 18:26:11 +0300
committerLinus Groh <mail@linusgroh.de>2021-06-18 20:17:45 +0100
commitd5c836dd6474190baac78e2949bb150aa2d6e8d8 (patch)
treeb76cbcbdb42979d7dec52c12bbf8a4c1020d5475 /Userland
parent57db27bcc4b707945fb512dcd95e9de62c323a72 (diff)
downloadserenity-d5c836dd6474190baac78e2949bb150aa2d6e8d8.zip
LibJS: Add the TypedArray.prototype.toString property
This is initialized to be the same function object as the initial value of the Array.prototype.toString generic function.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp
index 49dd8536ca..f5e559697a 100644
--- a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp
+++ b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp
@@ -35,6 +35,9 @@ void TypedArrayPrototype::initialize(GlobalObject& object)
define_native_function(vm.names.join, join, 1, attr);
define_native_accessor(vm.well_known_symbol_to_string_tag(), to_string_tag_getter, nullptr, Attribute::Configurable);
+
+ // 23.2.3.29 %TypedArray%.prototype.toString ( ), https://tc39.es/ecma262/#sec-%typedarray%.prototype.tostring
+ define_property(vm.names.toString, global_object().array_prototype()->get_without_side_effects(vm.names.toString), attr);
}
TypedArrayPrototype::~TypedArrayPrototype()