Skip to content

throw on .next() when windows cannot yield at least 1 full window #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion spec.emu
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ copyright: false
1. Let _buffer_ be a new empty List.
1. Repeat,
1. Let _value_ be ? IteratorStepValue(_iterated_).
1. If _value_ is ~done~, return ReturnCompletion(*undefined*).
1. If _value_ is ~done~, then
1. If _buffer_ is not empty and the number of elements in _buffer_ < ℝ(_windowSize_), throw a *TypeError* exception.
1. Return ReturnCompletion(*undefined*).
1. Append _value_ to _buffer_.
1. If the number of elements in _buffer_ is ℝ(_windowSize_), then
1. Let _completion_ be Completion(Yield(CreateArrayFromList(_buffer_))).
Expand Down