1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:07:47 +00:00

LibJS: Convert IteratorValue AO to ThrowCompletionOr

This commit is contained in:
Timothy Flynn 2021-10-20 09:05:52 -04:00 committed by Linus Groh
parent a64752cd34
commit 7b4814f74c
8 changed files with 20 additions and 21 deletions

View file

@ -66,12 +66,12 @@ ThrowCompletionOr<bool> iterator_complete(GlobalObject& global_object, Object& i
}
// 7.4.4 IteratorValue ( iterResult ), https://tc39.es/ecma262/#sec-iteratorvalue
Value iterator_value(GlobalObject& global_object, Object& iterator_result)
ThrowCompletionOr<Value> iterator_value(GlobalObject& global_object, Object& iterator_result)
{
auto& vm = global_object.vm();
// 1. Return ? Get(iterResult, "value").
return TRY_OR_DISCARD(iterator_result.get(vm.names.value));
return TRY(iterator_result.get(vm.names.value));
}
// 7.4.5 IteratorStep ( iteratorRecord ), https://tc39.es/ecma262/#sec-iteratorstep