1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:28:11 +00:00

LibJS: Make ArrayPrototype an Array object

https://tc39.es/ecma262/#sec-properties-of-the-array-prototype-object

The Array prototype object: [...] is an Array exotic object and has the
internal methods specified for such objects.

NOTE: The Array prototype object is specified to be an Array exotic
object to ensure compatibility with ECMAScript code that was created
prior to the ECMAScript 2015 specification.
This commit is contained in:
Linus Groh 2021-02-24 09:48:29 +01:00 committed by Andreas Kling
parent 84996c6567
commit a72276407b
5 changed files with 13 additions and 9 deletions

View file

@ -38,8 +38,13 @@ Array* Array::create(GlobalObject& global_object)
Array::Array(Object& prototype)
: Object(prototype)
{
}
void Array::initialize(GlobalObject& global_object)
{
auto& vm = this->vm();
Object::initialize(global_object);
define_native_property(vm.names.length, length_getter, length_setter, Attribute::Writable);
}