You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>This method performs the following steps when called:</p>
45
45
<emu-alg>
46
46
1. Let _O_ be the *this* value.
@@ -49,13 +49,17 @@ copyright: false
49
49
1. If _windowSize_ is not an integral Number in the inclusive interval from *1*<sub>𝔽</sub> to 𝔽(2<sup>32</sup> - 1), then
50
50
1. Let _error_ be ThrowCompletion(a newly created *RangeError* object).
51
51
1. Return ? IteratorClose(_iterated_, _error_).
52
+
1. If _undersized_ is *undefined*, set _undersized_ to *"skip"*.
53
+
1. If _undersized_ is neither *"skip"* nor *"truncate"*, then
54
+
1. Let _error_ be ThrowCompletion(a newly created *TypeError* object).
55
+
1. Return ? IteratorClose(_iterated_, _error_).
52
56
1. Set _iterated_ to ? GetIteratorDirect(_O_).
53
-
1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterated_and _windowSize_ and performs the following steps when called:
57
+
1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterated_, _windowSize_, and _undersized_ and performs the following steps when called:
54
58
1. Let _buffer_ be a new empty List.
55
59
1. Repeat,
56
60
1. Let _value_ be ? IteratorStepValue(_iterated_).
57
61
1. If _value_ is ~done~, then
58
-
1. If _buffer_ is not empty and the number of elements in _buffer_ < ℝ(_windowSize_), then
62
+
1. If _undersized_ is *"truncate"*, _buffer_ is not empty, and the number of elements in _buffer_ < ℝ(_windowSize_), then
0 commit comments