mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-02 20:42:11 +02:00
LibJS: Convert IteratorValue AO to ThrowCompletionOr
This commit is contained in:
committed by
Linus Groh
parent
a64752cd34
commit
7b4814f74c
Notes:
sideshowbarker
2024-07-18 02:06:59 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/7b4814f74c0 Pull-request: https://github.com/SerenityOS/serenity/pull/10546 Reviewed-by: https://github.com/IdanHo Reviewed-by: https://github.com/linusg ✅
@@ -57,9 +57,7 @@ ThrowCompletionOr<MarkedValueList> iterable_to_list_of_type(GlobalObject& global
|
||||
// b. If next is not false, then
|
||||
if (next) {
|
||||
// i. Let nextValue be ? IteratorValue(next).
|
||||
auto next_value = iterator_value(global_object, *iterator_result);
|
||||
if (auto* exception = vm.exception())
|
||||
return throw_completion(exception->value());
|
||||
auto next_value = TRY(iterator_value(global_object, *iterator_result));
|
||||
// ii. If Type(nextValue) is not an element of elementTypes, then
|
||||
if (auto type = to_option_type(next_value); !type.has_value() || !element_types.contains_slow(*type)) {
|
||||
// 1. Let completion be ThrowCompletion(a newly created TypeError object).
|
||||
|
||||
Reference in New Issue
Block a user