diff --git a/spec.html b/spec.html index acdd9d74e0..e8afe590ee 100644 --- a/spec.html +++ b/spec.html @@ -48683,16 +48683,18 @@

Iterator.prototype.drop ( _limit_ )

1. If _numLimit_ is *NaN*, then 1. Let _error_ be ThrowCompletion(a newly created *RangeError* object). 1. Return ? IteratorClose(_iterated_, _error_). + 1. If _numLimit_ is finite and _numLimit_ > 𝔽(253 - 1), then + 1. Let _error_ be ThrowCompletion(a newly created *RangeError* object). + 1. Return ? IteratorClose(_iterated_, _error_). 1. Let _integerLimit_ be ! ToIntegerOrInfinity(_numLimit_). 1. If _integerLimit_ < 0, then 1. Let _error_ be ThrowCompletion(a newly created *RangeError* object). 1. Return ? IteratorClose(_iterated_, _error_). 1. Set _iterated_ to ? GetIteratorDirect(_obj_). 1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterated_ and _integerLimit_ and performs the following steps when called: - 1. Let _remaining_ be _integerLimit_. - 1. Repeat, while _remaining_ > 0, - 1. If _remaining_ ≠ +∞, then - 1. Set _remaining_ to _remaining_ - 1. + 1. Let _remaining_ be 𝔽(_integerLimit_). + 1. Repeat, while _remaining_ > *+0*𝔽, + 1. Set _remaining_ to _remaining_ - *1*𝔽. 1. Let _next_ be ? IteratorStep(_iterated_). 1. If _next_ is ~done~, return ReturnCompletion(*undefined*). 1. Repeat, @@ -48717,14 +48719,14 @@

Iterator.prototype.every ( _predicate_ )

1. Let _error_ be ThrowCompletion(a newly created *TypeError* object). 1. Return ? IteratorClose(_iterated_, _error_). 1. Set _iterated_ to ? GetIteratorDirect(_obj_). - 1. Let _counter_ be 0. + 1. Let _counter_ be *+0*𝔽. 1. Repeat, 1. Let _value_ be ? IteratorStepValue(_iterated_). 1. If _value_ is ~done~, return *true*. - 1. Let _result_ be Completion(Call(_predicate_, *undefined*, « _value_, 𝔽(_counter_) »)). + 1. Let _result_ be Completion(Call(_predicate_, *undefined*, « _value_, _counter_ »)). 1. IfAbruptCloseIterator(_result_, _iterated_). 1. If ToBoolean(_result_) is *false*, return ? IteratorClose(_iterated_, NormalCompletion(*false*)). - 1. Set _counter_ to _counter_ + 1. + 1. Set _counter_ to _counter_ + *1*𝔽. @@ -48740,16 +48742,16 @@

Iterator.prototype.filter ( _predicate_ )

1. Return ? IteratorClose(_iterated_, _error_). 1. Set _iterated_ to ? GetIteratorDirect(_obj_). 1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterated_ and _predicate_ and performs the following steps when called: - 1. Let _counter_ be 0. + 1. Let _counter_ be *+0*𝔽. 1. Repeat, 1. Let _value_ be ? IteratorStepValue(_iterated_). 1. If _value_ is ~done~, return ReturnCompletion(*undefined*). - 1. Let _selected_ be Completion(Call(_predicate_, *undefined*, « _value_, 𝔽(_counter_) »)). + 1. Let _selected_ be Completion(Call(_predicate_, *undefined*, « _value_, _counter_ »)). 1. IfAbruptCloseIterator(_selected_, _iterated_). 1. If ToBoolean(_selected_) is *true*, then 1. Let _completion_ be Completion(Yield(_value_)). 1. IfAbruptCloseIterator(_completion_, _iterated_). - 1. Set _counter_ to _counter_ + 1. + 1. Set _counter_ to _counter_ + *1*𝔽. 1. Let _result_ be CreateIteratorFromClosure(_closure_, *"Iterator Helper"*, %IteratorHelperPrototype%, « [[UnderlyingIterators]] »). 1. Set _result_.[[UnderlyingIterators]] to « _iterated_ ». 1. Return _result_. @@ -48767,14 +48769,14 @@

Iterator.prototype.find ( _predicate_ )

1. Let _error_ be ThrowCompletion(a newly created *TypeError* object). 1. Return ? IteratorClose(_iterated_, _error_). 1. Set _iterated_ to ? GetIteratorDirect(_obj_). - 1. Let _counter_ be 0. + 1. Let _counter_ be *+0*𝔽. 1. Repeat, 1. Let _value_ be ? IteratorStepValue(_iterated_). 1. If _value_ is ~done~, return *undefined*. - 1. Let _result_ be Completion(Call(_predicate_, *undefined*, « _value_, 𝔽(_counter_) »)). + 1. Let _result_ be Completion(Call(_predicate_, *undefined*, « _value_, _counter_ »)). 1. IfAbruptCloseIterator(_result_, _iterated_). 1. If ToBoolean(_result_) is *true*, return ? IteratorClose(_iterated_, NormalCompletion(_value_)). - 1. Set _counter_ to _counter_ + 1. + 1. Set _counter_ to _counter_ + *1*𝔽. @@ -48790,11 +48792,11 @@

Iterator.prototype.flatMap ( _mapper_ )

1. Return ? IteratorClose(_iterated_, _error_). 1. Set _iterated_ to ? GetIteratorDirect(_obj_). 1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterated_ and _mapper_ and performs the following steps when called: - 1. Let _counter_ be 0. + 1. Let _counter_ be *+0*𝔽. 1. Repeat, 1. Let _value_ be ? IteratorStepValue(_iterated_). 1. If _value_ is ~done~, return ReturnCompletion(*undefined*). - 1. Let _mapped_ be Completion(Call(_mapper_, *undefined*, « _value_, 𝔽(_counter_) »)). + 1. Let _mapped_ be Completion(Call(_mapper_, *undefined*, « _value_, _counter_ »)). 1. IfAbruptCloseIterator(_mapped_, _iterated_). 1. Let _innerIterator_ be Completion(GetIteratorFlattenable(_mapped_, ~reject-primitives~)). 1. IfAbruptCloseIterator(_innerIterator_, _iterated_). @@ -48810,7 +48812,7 @@

Iterator.prototype.flatMap ( _mapper_ )

1. Let _backupCompletion_ be Completion(IteratorClose(_innerIterator_, _completion_)). 1. IfAbruptCloseIterator(_backupCompletion_, _iterated_). 1. Return ? IteratorClose(_iterated_, _completion_). - 1. Set _counter_ to _counter_ + 1. + 1. Set _counter_ to _counter_ + *1*𝔽. 1. Let _result_ be CreateIteratorFromClosure(_closure_, *"Iterator Helper"*, %IteratorHelperPrototype%, « [[UnderlyingIterators]] »). 1. Set _result_.[[UnderlyingIterators]] to « _iterated_ ». 1. Return _result_. @@ -48828,13 +48830,13 @@

Iterator.prototype.forEach ( _procedure_ )

1. Let _error_ be ThrowCompletion(a newly created *TypeError* object). 1. Return ? IteratorClose(_iterated_, _error_). 1. Set _iterated_ to ? GetIteratorDirect(_obj_). - 1. Let _counter_ be 0. + 1. Let _counter_ be *+0*𝔽. 1. Repeat, 1. Let _value_ be ? IteratorStepValue(_iterated_). 1. If _value_ is ~done~, return *undefined*. - 1. Let _result_ be Completion(Call(_procedure_, *undefined*, « _value_, 𝔽(_counter_) »)). + 1. Let _result_ be Completion(Call(_procedure_, *undefined*, « _value_, _counter_ »)). 1. IfAbruptCloseIterator(_result_, _iterated_). - 1. Set _counter_ to _counter_ + 1. + 1. Set _counter_ to _counter_ + *1*𝔽. @@ -48850,15 +48852,15 @@

Iterator.prototype.map ( _mapper_ )

1. Return ? IteratorClose(_iterated_, _error_). 1. Set _iterated_ to ? GetIteratorDirect(_obj_). 1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterated_ and _mapper_ and performs the following steps when called: - 1. Let _counter_ be 0. + 1. Let _counter_ be *+0*𝔽. 1. Repeat, 1. Let _value_ be ? IteratorStepValue(_iterated_). 1. If _value_ is ~done~, return ReturnCompletion(*undefined*). - 1. Let _mapped_ be Completion(Call(_mapper_, *undefined*, « _value_, 𝔽(_counter_) »)). + 1. Let _mapped_ be Completion(Call(_mapper_, *undefined*, « _value_, _counter_ »)). 1. IfAbruptCloseIterator(_mapped_, _iterated_). 1. Let _completion_ be Completion(Yield(_mapped_)). 1. IfAbruptCloseIterator(_completion_, _iterated_). - 1. Set _counter_ to _counter_ + 1. + 1. Set _counter_ to _counter_ + *1*𝔽. 1. Let _result_ be CreateIteratorFromClosure(_closure_, *"Iterator Helper"*, %IteratorHelperPrototype%, « [[UnderlyingIterators]] »). 1. Set _result_.[[UnderlyingIterators]] to « _iterated_ ». 1. Return _result_. @@ -48879,17 +48881,17 @@

Iterator.prototype.reduce ( _reducer_ [ , _initialValue_ ] )

1. If _initialValue_ is not present, then 1. Let _accumulator_ be ? IteratorStepValue(_iterated_). 1. If _accumulator_ is ~done~, throw a *TypeError* exception. - 1. Let _counter_ be 1. + 1. Let _counter_ be *1*𝔽. 1. Else, 1. Let _accumulator_ be _initialValue_. - 1. Let _counter_ be 0. + 1. Let _counter_ be *+0*𝔽. 1. Repeat, 1. Let _value_ be ? IteratorStepValue(_iterated_). 1. If _value_ is ~done~, return _accumulator_. - 1. Let _result_ be Completion(Call(_reducer_, *undefined*, « _accumulator_, _value_, 𝔽(_counter_) »)). + 1. Let _result_ be Completion(Call(_reducer_, *undefined*, « _accumulator_, _value_, _counter_ »)). 1. IfAbruptCloseIterator(_result_, _iterated_). 1. Set _accumulator_ to _result_. - 1. Set _counter_ to _counter_ + 1. + 1. Set _counter_ to _counter_ + *1*𝔽. @@ -48904,14 +48906,14 @@

Iterator.prototype.some ( _predicate_ )

1. Let _error_ be ThrowCompletion(a newly created *TypeError* object). 1. Return ? IteratorClose(_iterated_, _error_). 1. Set _iterated_ to ? GetIteratorDirect(_obj_). - 1. Let _counter_ be 0. + 1. Let _counter_ be *+0*𝔽. 1. Repeat, 1. Let _value_ be ? IteratorStepValue(_iterated_). 1. If _value_ is ~done~, return *false*. - 1. Let _result_ be Completion(Call(_predicate_, *undefined*, « _value_, 𝔽(_counter_) »)). + 1. Let _result_ be Completion(Call(_predicate_, *undefined*, « _value_, _counter_ »)). 1. IfAbruptCloseIterator(_result_, _iterated_). 1. If ToBoolean(_result_) is *true*, return ? IteratorClose(_iterated_, NormalCompletion(*true*)). - 1. Set _counter_ to _counter_ + 1. + 1. Set _counter_ to _counter_ + *1*𝔽. @@ -48927,18 +48929,20 @@

Iterator.prototype.take ( _limit_ )

1. If _numLimit_ is *NaN*, then 1. Let _error_ be ThrowCompletion(a newly created *RangeError* object). 1. Return ? IteratorClose(_iterated_, _error_). + 1. If _numLimit_ is finite and _numLimit_ > 𝔽(253 - 1), then + 1. Let _error_ be ThrowCompletion(a newly created *RangeError* object). + 1. Return ? IteratorClose(_iterated_, _error_). 1. Let _integerLimit_ be ! ToIntegerOrInfinity(_numLimit_). 1. If _integerLimit_ < 0, then 1. Let _error_ be ThrowCompletion(a newly created *RangeError* object). 1. Return ? IteratorClose(_iterated_, _error_). 1. Set _iterated_ to ? GetIteratorDirect(_obj_). 1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterated_ and _integerLimit_ and performs the following steps when called: - 1. Let _remaining_ be _integerLimit_. + 1. Let _remaining_ be 𝔽(_integerLimit_). 1. Repeat, - 1. If _remaining_ = 0, then + 1. If _remaining_ is *+0*𝔽, then 1. Return ? IteratorClose(_iterated_, ReturnCompletion(*undefined*)). - 1. If _remaining_ ≠ +∞, then - 1. Set _remaining_ to _remaining_ - 1. + 1. Set _remaining_ to _remaining_ - *1*𝔽. 1. Let _value_ be ? IteratorStepValue(_iterated_). 1. If _value_ is ~done~, return ReturnCompletion(*undefined*). 1. Let _completion_ be Completion(Yield(_value_)).