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.
This commit is contained in:
Linus Groh 2021-01-24 22:01:39 +01:00 committed by Andreas Kling
commit 02cca92763
Notes: sideshowbarker 2024-07-18 22:53:18 +09:00

View file

@ -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() \