Skip to content

Commit a67a285

Browse files
fixes #21: inline IteratorStep so we can IteratorValue the result object (#23)
1 parent 463e6f7 commit a67a285

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

spec.emu

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,14 @@ 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 ? IteratorStep(_iteratorRecord_).
29-
1. If _iteratorResult_ is ~done~, then
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*.
3036
1. Perform ? IteratorValue(_iteratorResult_).
3137
1. Set _innerAlive_ to *false*.
3238
1. Else,

0 commit comments

Comments
 (0)