1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:57:35 +00:00

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
parent 76e12a4840
commit 02cca92763

View file

@ -112,7 +112,7 @@ void TypedArrayBase::visit_edges(Visitor& visitor)
auto& vm = this->vm(); \ auto& vm = this->vm(); \
NativeFunction::initialize(global_object); \ NativeFunction::initialize(global_object); \
define_property(vm.names.prototype, global_object.snake_name##_prototype(), 0); \ 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); \ define_property(vm.names.BYTES_PER_ELEMENT, Value((i32)sizeof(Type)), 0); \
} \ } \
Value ConstructorName::call() \ Value ConstructorName::call() \