mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +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
|
@ -241,17 +241,17 @@ ThrowCompletionOr<GroupsType> group_by(VM& vm, Value items, Value callback_funct
|
|||
return iterator_close(vm, iterator_record, move(error));
|
||||
}
|
||||
|
||||
// b. Let next be ? IteratorStep(iteratorRecord).
|
||||
auto next = TRY(iterator_step(vm, iterator_record));
|
||||
// b. Let next be ? IteratorStepValue(iteratorRecord).
|
||||
auto next = TRY(iterator_step_value(vm, iterator_record));
|
||||
|
||||
// c. If next is false, then
|
||||
if (!next) {
|
||||
// c. If next is DONE, then
|
||||
if (!next.has_value()) {
|
||||
// i. Return groups.
|
||||
return ThrowCompletionOr<GroupsType> { move(groups) };
|
||||
}
|
||||
|
||||
// d. Let value be ? IteratorValue(next).
|
||||
auto value = TRY(iterator_value(vm, *next));
|
||||
// d. Let value be next.
|
||||
auto value = next.release_value();
|
||||
|
||||
// e. Let key be Completion(Call(callbackfn, undefined, « value, 𝔽(k) »)).
|
||||
auto key = call(vm, callback_function, js_undefined(), value, Value(k));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue