diff --git a/spec.emu b/spec.emu index 86c45b8..ff68a3f 100644 --- a/spec.emu +++ b/spec.emu @@ -15,8 +15,11 @@ copyright: false 1. Let _O_ be the *this* value. 1. If _O_ is not an Object, throw a *TypeError* exception. - 1. If _chunkSize_ is not an integral Number in the inclusive interval from *1*𝔽 to 𝔽(232 - 1), throw a *RangeError* exception. - 1. Let _iterated_ be ? GetIteratorDirect(_O_). + 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _O_, [[NextMethod]]: *undefined*, [[Done]]: *false* }. + 1. If _chunkSize_ is not an integral Number in the inclusive interval from *1*𝔽 to 𝔽(232 - 1), then + 1. Let _error_ be ThrowCompletion(a newly created *RangeError* object). + 1. Return ? IteratorClose(_iterated_, _error_). + 1. Set _iterated_ to ? GetIteratorDirect(_O_). 1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterated_ and _chunkSize_ and performs the following steps when called: 1. Let _buffer_ be a new empty List. 1. Repeat, @@ -42,8 +45,11 @@ copyright: false 1. Let _O_ be the *this* value. 1. If _O_ is not an Object, throw a *TypeError* exception. - 1. If _windowSize_ is not an integral Number in the inclusive interval from *1*𝔽 to 𝔽(232 - 1), throw a *RangeError* exception. - 1. Let _iterated_ be ? GetIteratorDirect(_O_). + 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _O_, [[NextMethod]]: *undefined*, [[Done]]: *false* }. + 1. If _windowSize_ is not an integral Number in the inclusive interval from *1*𝔽 to 𝔽(232 - 1), then + 1. Let _error_ be ThrowCompletion(a newly created *RangeError* object). + 1. Return ? IteratorClose(_iterated_, _error_). + 1. Set _iterated_ to ? GetIteratorDirect(_O_). 1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterated_ and _windowSize_ and performs the following steps when called: 1. Let _buffer_ be a new empty List. 1. Repeat,