@@ -15,8 +15,11 @@ copyright: false
15
15
<emu-alg>
16
16
1. Let _O_ be the *this* value.
17
17
1. If _O_ is not an Object, throw a *TypeError* exception.
18
- 1. If _chunkSize_ is not an integral Number in the inclusive interval from *1*<sub>𝔽</sub> to 𝔽(2<sup>32</sup> - 1), throw a *RangeError* exception.
19
- 1. Let _iterated_ be ? GetIteratorDirect(_O_).
18
+ 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _O_, [[NextMethod]]: *undefined*, [[Done]]: *false* }.
19
+ 1. If _chunkSize_ is not an integral Number in the inclusive interval from *1*<sub>𝔽</sub> to 𝔽(2<sup>32</sup> - 1), then
20
+ 1. Let _error_ be ThrowCompletion(a newly created *RangeError* object).
21
+ 1. Return ? IteratorClose(_iterated_, _error_).
22
+ 1. Set _iterated_ to ? GetIteratorDirect(_O_).
20
23
1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterated_ and _chunkSize_ and performs the following steps when called:
21
24
1. Let _buffer_ be a new empty List.
22
25
1. Repeat,
@@ -42,8 +45,11 @@ copyright: false
42
45
<emu-alg>
43
46
1. Let _O_ be the *this* value.
44
47
1. If _O_ is not an Object, throw a *TypeError* exception.
45
- 1. If _windowSize_ is not an integral Number in the inclusive interval from *1*<sub>𝔽</sub> to 𝔽(2<sup>32</sup> - 1), throw a *RangeError* exception.
46
- 1. Let _iterated_ be ? GetIteratorDirect(_O_).
48
+ 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _O_, [[NextMethod]]: *undefined*, [[Done]]: *false* }.
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
+ 1. Let _error_ be ThrowCompletion(a newly created *RangeError* object).
51
+ 1. Return ? IteratorClose(_iterated_, _error_).
52
+ 1. Set _iterated_ to ? GetIteratorDirect(_O_).
47
53
1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterated_ and _windowSize_ and performs the following steps when called:
48
54
1. Let _buffer_ be a new empty List.
49
55
1. Repeat,
0 commit comments