mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 15:18:11 +00:00
LibJS: Convert IteratorComplete AO to ThrowCompletionOr
This commit is contained in:
parent
8be1caa05d
commit
a64752cd34
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