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

LibJS: Convert GetIterator AO to ThrowCompletionOr

This commit is contained in:
Timothy Flynn 2021-10-20 08:24:54 -04:00 committed by Linus Groh
parent a3b3800cd4
commit 860a37640b
9 changed files with 56 additions and 48 deletions

View file

@ -478,7 +478,10 @@ void PutByValue::execute_impl(Bytecode::Interpreter& interpreter) const
void GetIterator::execute_impl(Bytecode::Interpreter& interpreter) const
{
interpreter.accumulator() = get_iterator(interpreter.global_object(), interpreter.accumulator());
auto iterator_or_error = get_iterator(interpreter.global_object(), interpreter.accumulator());
if (iterator_or_error.is_error())
return;
interpreter.accumulator() = iterator_or_error.release_value();
}
void IteratorNext::execute_impl(Bytecode::Interpreter& interpreter) const