mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 23:25:20 +00:00
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:
committed by
Linus Groh
parent
5ee1ae37b2
commit
e480d69130
@@ -431,7 +431,7 @@ Value ProxyObject::call()
|
||||
arguments.append(Value(&m_target));
|
||||
arguments.append(Value(&m_handler));
|
||||
// FIXME: Pass global object
|
||||
auto arguments_array = Array::create(global_object());
|
||||
auto arguments_array = Array::create(global_object(), 0);
|
||||
vm.for_each_argument([&](auto& argument) {
|
||||
arguments_array->indexed_properties().append(argument);
|
||||
});
|
||||
@@ -458,7 +458,7 @@ Value ProxyObject::construct(FunctionObject& new_target)
|
||||
return static_cast<FunctionObject&>(m_target).construct(new_target);
|
||||
MarkedValueList arguments(vm.heap());
|
||||
arguments.append(Value(&m_target));
|
||||
auto arguments_array = Array::create(global_object());
|
||||
auto arguments_array = Array::create(global_object(), 0);
|
||||
vm.for_each_argument([&](auto& argument) {
|
||||
arguments_array->indexed_properties().append(argument);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user