1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 23:17:45 +00:00

LibJS: Implement the IteratorStepValue AO

This is an editorial change in the ECMA-262 spec. See:
12d3687

This AO is meant to replace usages of IteratorNext followed by
IteratorValue with a single operation.
This commit is contained in:
Timothy Flynn 2024-02-01 14:52:07 -05:00 committed by Tim Flynn
parent 3ca86cd044
commit 2b96e732dd
2 changed files with 62 additions and 6 deletions

View file

@ -76,6 +76,7 @@ ThrowCompletionOr<NonnullGCPtr<IteratorRecord>> get_iterator_direct(VM&, Object&
ThrowCompletionOr<NonnullGCPtr<IteratorRecord>> get_iterator_flattenable(VM&, Value, StringHandling);
ThrowCompletionOr<NonnullGCPtr<Object>> iterator_next(VM&, IteratorRecord const&, Optional<Value> = {});
ThrowCompletionOr<GCPtr<Object>> iterator_step(VM&, IteratorRecord const&);
ThrowCompletionOr<Optional<Value>> iterator_step_value(VM&, IteratorRecord&);
ThrowCompletionOr<bool> iterator_complete(VM&, Object& iterator_result);
ThrowCompletionOr<Value> iterator_value(VM&, Object& iterator_result);
Completion iterator_close(VM&, IteratorRecord const&, Completion);