LibJS: Bring ArrayCreate and ArrayConstructor closer to spec

Specifically, this now explicitly takes the length, adds missing
exceptions checks to calls with user-supplied lengths, takes and uses
the prototype argument, and fixes some spec non-conformance in
ArrayConstructor and its native functions around the use of ArrayCreate
This commit is contained in:
Idan Horowitz 2021-07-04 01:36:44 +03:00 committed by Linus Groh
commit e480d69130
Notes: sideshowbarker 2024-07-18 10:31:25 +09:00
17 changed files with 172 additions and 96 deletions

View file

@ -21,7 +21,7 @@ NavigatorObject::NavigatorObject(JS::GlobalObject& global_object)
void NavigatorObject::initialize(JS::GlobalObject& global_object)
{
auto& heap = this->heap();
auto* languages = JS::Array::create(global_object);
auto* languages = JS::Array::create(global_object, 0);
languages->indexed_properties().append(js_string(heap, "en-US"));
define_property("appCodeName", js_string(heap, "Mozilla"));