mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +00:00
LibJS: Convert IteratorComplete AO to ThrowCompletionOr
This commit is contained in:
parent
8be1caa05d
commit
a64752cd34
Notes:
sideshowbarker
2024-07-18 02:07:03 +09:00
Author: https://github.com/trflynn89
Commit: a64752cd34
Pull-request: https://github.com/SerenityOS/serenity/pull/10546
Reviewed-by: https://github.com/IdanHo
Reviewed-by: https://github.com/linusg ✅
4 changed files with 15 additions and 13 deletions
|
@ -149,9 +149,10 @@ void IteratorToArray::execute_impl(Bytecode::Interpreter& interpreter) const
|
|||
return;
|
||||
auto* iterator_result = iterator_result_or_error.release_value();
|
||||
|
||||
auto complete = iterator_complete(global_object, *iterator_result);
|
||||
if (vm.exception())
|
||||
auto complete_or_error = iterator_complete(global_object, *iterator_result);
|
||||
if (complete_or_error.is_error())
|
||||
return;
|
||||
auto complete = complete_or_error.release_value();
|
||||
|
||||
if (complete) {
|
||||
interpreter.accumulator() = array;
|
||||
|
@ -506,7 +507,13 @@ void IteratorResultDone::execute_impl(Bytecode::Interpreter& interpreter) const
|
|||
if (iterator_result_or_error.is_error())
|
||||
return;
|
||||
auto* iterator_result = iterator_result_or_error.release_value();
|
||||
interpreter.accumulator() = Value(iterator_complete(interpreter.global_object(), *iterator_result));
|
||||
|
||||
auto complete_or_error = iterator_complete(interpreter.global_object(), *iterator_result);
|
||||
if (complete_or_error.is_error())
|
||||
return;
|
||||
auto complete = complete_or_error.release_value();
|
||||
|
||||
interpreter.accumulator() = Value(complete);
|
||||
}
|
||||
|
||||
void IteratorResultValue::execute_impl(Bytecode::Interpreter& interpreter) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue