@@ -46794,8 +46794,11 @@ <h1>Iterator.prototype.every ( _predicate_ )</h1>
46794
46794
<emu-alg>
46795
46795
1. Let _O_ be the *this* value.
46796
46796
1. If _O_ is not an Object, throw a *TypeError* exception.
46797
- 1. If IsCallable(_predicate_) is *false*, throw a *TypeError* exception.
46798
- 1. Let _iterated_ be ? GetIteratorDirect(_O_).
46797
+ 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _O_, [[NextMethod]]: *undefined*, [[Done]]: *false* }.
46798
+ 1. If IsCallable(_predicate_) is *false*, then
46799
+ 1. Let _error_ be ThrowCompletion(a newly created *TypeError* object).
46800
+ 1. Return ? IteratorClose(_iterated_, _error_).
46801
+ 1. Set _iterated_ to ? GetIteratorDirect(_O_).
46799
46802
1. Let _counter_ be 0.
46800
46803
1. Repeat,
46801
46804
1. Let _value_ be ? IteratorStepValue(_iterated_).
@@ -46841,8 +46844,11 @@ <h1>Iterator.prototype.find ( _predicate_ )</h1>
46841
46844
<emu-alg>
46842
46845
1. Let _O_ be the *this* value.
46843
46846
1. If _O_ is not an Object, throw a *TypeError* exception.
46844
- 1. If IsCallable(_predicate_) is *false*, throw a *TypeError* exception.
46845
- 1. Let _iterated_ be ? GetIteratorDirect(_O_).
46847
+ 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _O_, [[NextMethod]]: *undefined*, [[Done]]: *false* }.
46848
+ 1. If IsCallable(_predicate_) is *false*, then
46849
+ 1. Let _error_ be ThrowCompletion(a newly created *TypeError* object).
46850
+ 1. Return ? IteratorClose(_iterated_, _error_).
46851
+ 1. Set _iterated_ to ? GetIteratorDirect(_O_).
46846
46852
1. Let _counter_ be 0.
46847
46853
1. Repeat,
46848
46854
1. Let _value_ be ? IteratorStepValue(_iterated_).
@@ -46899,8 +46905,11 @@ <h1>Iterator.prototype.forEach ( _procedure_ )</h1>
46899
46905
<emu-alg>
46900
46906
1. Let _O_ be the *this* value.
46901
46907
1. If _O_ is not an Object, throw a *TypeError* exception.
46902
- 1. If IsCallable(_procedure_) is *false*, throw a *TypeError* exception.
46903
- 1. Let _iterated_ be ? GetIteratorDirect(_O_).
46908
+ 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _O_, [[NextMethod]]: *undefined*, [[Done]]: *false* }.
46909
+ 1. If IsCallable(_procedure_) is *false*, then
46910
+ 1. Let _error_ be ThrowCompletion(a newly created *TypeError* object).
46911
+ 1. Return ? IteratorClose(_iterated_, _error_).
46912
+ 1. Set _iterated_ to ? GetIteratorDirect(_O_).
46904
46913
1. Let _counter_ be 0.
46905
46914
1. Repeat,
46906
46915
1. Let _value_ be ? IteratorStepValue(_iterated_).
@@ -46944,8 +46953,11 @@ <h1>Iterator.prototype.reduce ( _reducer_ [ , _initialValue_ ] )</h1>
46944
46953
<emu-alg>
46945
46954
1. Let _O_ be the *this* value.
46946
46955
1. If _O_ is not an Object, throw a *TypeError* exception.
46947
- 1. If IsCallable(_reducer_) is *false*, throw a *TypeError* exception.
46948
- 1. Let _iterated_ be ? GetIteratorDirect(_O_).
46956
+ 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _O_, [[NextMethod]]: *undefined*, [[Done]]: *false* }.
46957
+ 1. If IsCallable(_reducer_) is *false*, then
46958
+ 1. Let _error_ be ThrowCompletion(a newly created *TypeError* object).
46959
+ 1. Return ? IteratorClose(_iterated_, _error_).
46960
+ 1. Set _iterated_ to ? GetIteratorDirect(_O_).
46949
46961
1. If _initialValue_ is not present, then
46950
46962
1. Let _accumulator_ be ? IteratorStepValue(_iterated_).
46951
46963
1. If _accumulator_ is ~done~, throw a *TypeError* exception.
@@ -46969,8 +46981,11 @@ <h1>Iterator.prototype.some ( _predicate_ )</h1>
46969
46981
<emu-alg>
46970
46982
1. Let _O_ be the *this* value.
46971
46983
1. If _O_ is not an Object, throw a *TypeError* exception.
46972
- 1. If IsCallable(_predicate_) is *false*, throw a *TypeError* exception.
46973
- 1. Let _iterated_ be ? GetIteratorDirect(_O_).
46984
+ 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _O_, [[NextMethod]]: *undefined*, [[Done]]: *false* }.
46985
+ 1. If IsCallable(_predicate_) is *false*, then
46986
+ 1. Let _error_ be ThrowCompletion(a newly created *TypeError* object).
46987
+ 1. Return ? IteratorClose(_iterated_, _error_).
46988
+ 1. Set _iterated_ to ? GetIteratorDirect(_O_).
46974
46989
1. Let _counter_ be 0.
46975
46990
1. Repeat,
46976
46991
1. Let _value_ be ? IteratorStepValue(_iterated_).
0 commit comments