mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +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:
parent
5ee1ae37b2
commit
e480d69130
Notes:
sideshowbarker
2024-07-18 10:31:25 +09:00
Author: https://github.com/IdanHo
Commit: e480d69130
Pull-request: https://github.com/SerenityOS/serenity/pull/8415
Reviewed-by: https://github.com/linusg
17 changed files with 172 additions and 96 deletions
|
@ -467,7 +467,7 @@ Object* JSONObject::parse_json_object(GlobalObject& global_object, const JsonObj
|
|||
|
||||
Array* JSONObject::parse_json_array(GlobalObject& global_object, const JsonArray& json_array)
|
||||
{
|
||||
auto* array = Array::create(global_object);
|
||||
auto* array = Array::create(global_object, 0);
|
||||
size_t index = 0;
|
||||
json_array.for_each([&](auto& value) {
|
||||
array->define_property(index++, parse_json_value(global_object, value));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue