From 02cca9276315ac4e92083e1e25edf3e760f433ff Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sun, 24 Jan 2021 22:01:39 +0100 Subject: [PATCH] LibJS: Set length of TypedArray constructors to 3 https://tc39.es/ecma262/#sec-typedarray-constructors Each TypedArray constructor [...] has a "length" property whose value is 3. --- Userland/Libraries/LibJS/Runtime/TypedArray.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Runtime/TypedArray.cpp b/Userland/Libraries/LibJS/Runtime/TypedArray.cpp index 1375dfc099..13ba159848 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArray.cpp +++ b/Userland/Libraries/LibJS/Runtime/TypedArray.cpp @@ -112,7 +112,7 @@ void TypedArrayBase::visit_edges(Visitor& visitor) auto& vm = this->vm(); \ NativeFunction::initialize(global_object); \ define_property(vm.names.prototype, global_object.snake_name##_prototype(), 0); \ - define_property(vm.names.length, Value(1), Attribute::Configurable); \ + define_property(vm.names.length, Value(3), Attribute::Configurable); \ define_property(vm.names.BYTES_PER_ELEMENT, Value((i32)sizeof(Type)), 0); \ } \ Value ConstructorName::call() \