Skip to content

Commit 025c78e

Browse files
updates from May 2025 plenary (#26)
This effectively reverts #19/#23 (reading the last IteratorResult value) and #18 (re-using IteratorResult objects).
1 parent 2f8c21a commit 025c78e

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

spec.emu

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,11 @@ copyright: false
2525
1. Let _iteratorRecord_ be ? GetIteratorDirect(_iter_).
2626
1. Let _innerAlive_ be *true*.
2727
1. Repeat, while _innerAlive_ is *true*,
28-
1. Let _iteratorResult_ be ? IteratorNext(_iteratorRecord_).
29-
1. Let _done_ be Completion(IteratorComplete(_iteratorResult_)).
30-
1. If _done_ is a throw completion, then
31-
1. Set _iteratorRecord_.[[Done]] to *true*.
32-
1. Return ? _done_.
33-
1. Set _done_ to ! _done_.
34-
1. If _done_ is *true*, then
35-
1. Set _iteratorRecord_.[[Done]] to *true*.
36-
1. Perform ? IteratorValue(_iteratorResult_).
28+
1. Let _innerValue_ be ? IteratorStepValue(_iteratorRecord_).
29+
1. If _innerValue_ is ~done~, then
3730
1. Set _innerAlive_ to *false*.
3831
1. Else,
39-
1. Let _completion_ be Completion(GeneratorYield(_iteratorResult_)).
32+
1. Let _completion_ be Completion(Yield(_innerValue_)).
4033
1. If _completion_ is an abrupt completion, then
4134
1. Return ? IteratorClose(_iteratorRecord_, _completion_).
4235
1. Return ReturnCompletion(*undefined*).

0 commit comments

Comments
 (0)