Skip to content

Commit 32bd017

Browse files
fix spec text to yield undersized final chunk on exhaustion
1 parent 50e5209 commit 32bd017

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

spec.emu

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ copyright: false
2121
1. Let _buffer_ be a new empty List.
2222
1. Repeat,
2323
1. Let _value_ be ? IteratorStepValue(_iterated_).
24-
1. If _value_ is ~done~, return ~unused~.
24+
1. If _value_ is ~done~, then
25+
1. If _buffer_ is not empty, then
26+
1. Perform Completion(Yield(CreateArrayFromList(_buffer_))).
27+
1. Return ~unused~.
2528
1. Append _value_ to _buffer_.
2629
1. If the number of elements in _buffer_ is ℝ(_chunkSize_), then
2730
1. Let _completion_ be Completion(Yield(CreateArrayFromList(_buffer_))).

0 commit comments

Comments
 (0)