@@ -47391,8 +47391,11 @@ <h1>Iterator.prototype.every ( _predicate_ )</h1>
47391
47391
<emu-alg>
47392
47392
1. Let _O_ be the *this* value.
47393
47393
1. If _O_ is not an Object, throw a *TypeError* exception.
47394
- 1. If IsCallable(_predicate_) is *false*, throw a *TypeError* exception.
47395
- 1. Let _iterated_ be ? GetIteratorDirect(_O_).
47394
+ 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _O_, [[NextMethod]]: *undefined*, [[Done]]: *false* }.
47395
+ 1. If IsCallable(_predicate_) is *false*, then
47396
+ 1. Let _error_ be ThrowCompletion(a newly created *TypeError* object).
47397
+ 1. Return ? IteratorClose(_iterated_, _error_).
47398
+ 1. Set _iterated_ to ? GetIteratorDirect(_O_).
47396
47399
1. Let _counter_ be 0.
47397
47400
1. Repeat,
47398
47401
1. Let _value_ be ? IteratorStepValue(_iterated_).
@@ -47438,8 +47441,11 @@ <h1>Iterator.prototype.find ( _predicate_ )</h1>
47438
47441
<emu-alg>
47439
47442
1. Let _O_ be the *this* value.
47440
47443
1. If _O_ is not an Object, throw a *TypeError* exception.
47441
- 1. If IsCallable(_predicate_) is *false*, throw a *TypeError* exception.
47442
- 1. Let _iterated_ be ? GetIteratorDirect(_O_).
47444
+ 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _O_, [[NextMethod]]: *undefined*, [[Done]]: *false* }.
47445
+ 1. If IsCallable(_predicate_) is *false*, then
47446
+ 1. Let _error_ be ThrowCompletion(a newly created *TypeError* object).
47447
+ 1. Return ? IteratorClose(_iterated_, _error_).
47448
+ 1. Set _iterated_ to ? GetIteratorDirect(_O_).
47443
47449
1. Let _counter_ be 0.
47444
47450
1. Repeat,
47445
47451
1. Let _value_ be ? IteratorStepValue(_iterated_).
@@ -47496,8 +47502,11 @@ <h1>Iterator.prototype.forEach ( _procedure_ )</h1>
47496
47502
<emu-alg>
47497
47503
1. Let _O_ be the *this* value.
47498
47504
1. If _O_ is not an Object, throw a *TypeError* exception.
47499
- 1. If IsCallable(_procedure_) is *false*, throw a *TypeError* exception.
47500
- 1. Let _iterated_ be ? GetIteratorDirect(_O_).
47505
+ 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _O_, [[NextMethod]]: *undefined*, [[Done]]: *false* }.
47506
+ 1. If IsCallable(_procedure_) is *false*, then
47507
+ 1. Let _error_ be ThrowCompletion(a newly created *TypeError* object).
47508
+ 1. Return ? IteratorClose(_iterated_, _error_).
47509
+ 1. Set _iterated_ to ? GetIteratorDirect(_O_).
47501
47510
1. Let _counter_ be 0.
47502
47511
1. Repeat,
47503
47512
1. Let _value_ be ? IteratorStepValue(_iterated_).
@@ -47541,8 +47550,11 @@ <h1>Iterator.prototype.reduce ( _reducer_ [ , _initialValue_ ] )</h1>
47541
47550
<emu-alg>
47542
47551
1. Let _O_ be the *this* value.
47543
47552
1. If _O_ is not an Object, throw a *TypeError* exception.
47544
- 1. If IsCallable(_reducer_) is *false*, throw a *TypeError* exception.
47545
- 1. Let _iterated_ be ? GetIteratorDirect(_O_).
47553
+ 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _O_, [[NextMethod]]: *undefined*, [[Done]]: *false* }.
47554
+ 1. If IsCallable(_reducer_) is *false*, then
47555
+ 1. Let _error_ be ThrowCompletion(a newly created *TypeError* object).
47556
+ 1. Return ? IteratorClose(_iterated_, _error_).
47557
+ 1. Set _iterated_ to ? GetIteratorDirect(_O_).
47546
47558
1. If _initialValue_ is not present, then
47547
47559
1. Let _accumulator_ be ? IteratorStepValue(_iterated_).
47548
47560
1. If _accumulator_ is ~done~, throw a *TypeError* exception.
@@ -47566,8 +47578,11 @@ <h1>Iterator.prototype.some ( _predicate_ )</h1>
47566
47578
<emu-alg>
47567
47579
1. Let _O_ be the *this* value.
47568
47580
1. If _O_ is not an Object, throw a *TypeError* exception.
47569
- 1. If IsCallable(_predicate_) is *false*, throw a *TypeError* exception.
47570
- 1. Let _iterated_ be ? GetIteratorDirect(_O_).
47581
+ 1. Let _iterated_ be the Iterator Record { [[Iterator]]: _O_, [[NextMethod]]: *undefined*, [[Done]]: *false* }.
47582
+ 1. If IsCallable(_predicate_) is *false*, then
47583
+ 1. Let _error_ be ThrowCompletion(a newly created *TypeError* object).
47584
+ 1. Return ? IteratorClose(_iterated_, _error_).
47585
+ 1. Set _iterated_ to ? GetIteratorDirect(_O_).
47571
47586
1. Let _counter_ be 0.
47572
47587
1. Repeat,
47573
47588
1. Let _value_ be ? IteratorStepValue(_iterated_).
0 commit comments