mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibJS: Implement IteratorClose with Completions and align to the spec
This commit is contained in:
parent
04b4307b3d
commit
ec54a7b5b0
Notes:
sideshowbarker
2024-07-18 02:06:52 +09:00
Author: https://github.com/trflynn89
Commit: ec54a7b5b0
Pull-request: https://github.com/SerenityOS/serenity/pull/10546
Reviewed-by: https://github.com/IdanHo
Reviewed-by: https://github.com/linusg ✅
8 changed files with 97 additions and 79 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue