1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:07:47 +00:00

LibJS: Rename IterableToList to IteratorToList

This is an editorial change in the ECMA-262 spec. See:
ff60140

In doing so, as the new name implies, callsites are updated to pass in
an IteratorRecord themselves, rather than an iterable value.
This commit is contained in:
Timothy Flynn 2023-07-18 15:02:28 -04:00 committed by Andreas Kling
parent 1760361304
commit a7a109062a
6 changed files with 12 additions and 25 deletions

View file

@ -64,8 +64,8 @@ ThrowCompletionOr<NonnullGCPtr<Object>> AggregateErrorConstructor::construct(Fun
// 4. Perform ? InstallErrorCause(O, options).
TRY(aggregate_error->install_error_cause(options));
// 5. Let errorsList be ? IterableToList(errors).
auto errors_list = TRY(iterable_to_list(vm, errors));
// 5. Let errorsList be ? IteratorToList(? GetIterator(errors, sync)).
auto errors_list = TRY(iterator_to_list(vm, TRY(get_iterator(vm, errors, IteratorHint::Sync))));
// 6. Perform ! DefinePropertyOrThrow(O, "errors", PropertyDescriptor { [[Configurable]]: true, [[Enumerable]]: false, [[Writable]]: true, [[Value]]: CreateArrayFromList(errorsList) }).
MUST(aggregate_error->define_property_or_throw(vm.names.errors, { .value = Array::create_from(realm, errors_list), .writable = true, .enumerable = false, .configurable = true }));