1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:38:10 +00:00

LibJS: Implement IteratorClose with Completions and align to the spec

This commit is contained in:
Timothy Flynn 2021-10-20 13:36:14 -04:00 committed by Linus Groh
parent 04b4307b3d
commit ec54a7b5b0
8 changed files with 97 additions and 79 deletions

View file

@ -63,8 +63,7 @@ ThrowCompletionOr<MarkedValueList> iterable_to_list_of_type(GlobalObject& global
// 1. Let completion be ThrowCompletion(a newly created TypeError object).
auto completion = vm.throw_completion<TypeError>(global_object, ErrorType::IterableToListOfTypeInvalidValue, next_value.to_string_without_side_effects());
// 2. Return ? IteratorClose(iteratorRecord, completion).
iterator_close(*iterator_record);
return completion;
return iterator_close(*iterator_record, move(completion));
}
// iii. Append nextValue to the end of the List values.
values.append(next_value);