mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-16 05:51:55 +00:00
LibJS: Use IteratorStepValue in ECMA-262
This is an editorial change in the ECMA-262 spec. See:
12d3687
Note they have not yet updated all potential consumers to use this new
AO.
This commit is contained in:
parent
2b96e732dd
commit
18847fca50
Notes:
sideshowbarker
2024-07-17 05:09:48 +09:00
Author: https://github.com/trflynn89
Commit: 18847fca50
Pull-request: https://github.com/SerenityOS/serenity/pull/23041
9 changed files with 80 additions and 156 deletions
|
@ -66,12 +66,12 @@ ThrowCompletionOr<NonnullGCPtr<Object>> SetConstructor::construct(FunctionObject
|
|||
|
||||
// 7. Let iteratorRecord be ? GetIterator(iterable, sync).
|
||||
// 8. Repeat,
|
||||
// a. Let next be ? IteratorStep(iteratorRecord).
|
||||
// c. Let nextValue be ? IteratorValue(next).
|
||||
(void)TRY(get_iterator_values(vm, iterable, [&](Value next_value) -> Optional<Completion> {
|
||||
// d. Let status be Completion(Call(adder, set, « nextValue »)).
|
||||
// e. IfAbruptCloseIterator(status, iteratorRecord).
|
||||
TRY(JS::call(vm, adder.as_function(), set, next_value));
|
||||
(void)TRY(get_iterator_values(vm, iterable, [&](Value next) -> Optional<Completion> {
|
||||
// a. Let next be ? IteratorStepValue(iteratorRecord).
|
||||
// b. If next is DONE, return set.
|
||||
// c. Let status be Completion(Call(adder, set, « nextValue »)).
|
||||
// d. IfAbruptCloseIterator(status, iteratorRecord).
|
||||
TRY(JS::call(vm, adder.as_function(), set, next));
|
||||
return {};
|
||||
}));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue