diff --git a/spec.html b/spec.html index 90d2015448..ee7979a3ec 100644 --- a/spec.html +++ b/spec.html @@ -46804,9 +46804,9 @@

Iterator.prototype.drop ( _limit_ )

1. Let _next_ be ? IteratorStep(_iterated_). 1. If _next_ is ~done~, return ReturnCompletion(*undefined*). 1. Repeat, - 1. Let _value_ be ? IteratorStepValue(_iterated_). - 1. If _value_ is ~done~, return ReturnCompletion(*undefined*). - 1. Let _completion_ be Completion(Yield(_value_)). + 1. Let _iteratorResult_ be ? IteratorStep(_iterated_). + 1. If _iteratorResult_ is ~done~, return ReturnCompletion(*undefined*). + 1. Let _completion_ be Completion(GeneratorYield(_iteratorResult_)). 1. IfAbruptCloseIterator(_completion_, _iterated_). 1. Let _result_ be CreateIteratorFromClosure(_closure_, *"Iterator Helper"*, %IteratorHelperPrototype%, « [[UnderlyingIterator]] »). 1. Set _result_.[[UnderlyingIterator]] to _iterated_. @@ -46844,12 +46844,16 @@

Iterator.prototype.filter ( _predicate_ )

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. Repeat, - 1. Let _value_ be ? IteratorStepValue(_iterated_). - 1. If _value_ is ~done~, return ReturnCompletion(*undefined*). + 1. Let _iteratorResult_ be ? IteratorStep(_iterated_). + 1. If _iteratorResult_ is ~done~, return ReturnCompletion(*undefined*). + 1. Let _value_ be Completion(IteratorValue(_iteratorResult_)). + 1. If _value_ is a throw completion, then + 1. Set _iterated_.[[Done]] to *true*. + 1. Set _value_ to _value_.[[Value]]. 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. Let _completion_ be Completion(GeneratorYield(_iteratorResult_)). 1. IfAbruptCloseIterator(_completion_, _iterated_). 1. Set _counter_ to _counter_ + 1. 1. Let _result_ be CreateIteratorFromClosure(_closure_, *"Iterator Helper"*, %IteratorHelperPrototype%, « [[UnderlyingIterator]] »). @@ -47017,9 +47021,9 @@

Iterator.prototype.take ( _limit_ )

1. Return ? IteratorClose(_iterated_, ReturnCompletion(*undefined*)). 1. If _remaining_ ≠ +∞, then 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_)). + 1. Let _iteratorResult_ be ? IteratorStep(_iterated_). + 1. If _iteratorResult_ is ~done~, return ReturnCompletion(*undefined*). + 1. Let _completion_ be Completion(GeneratorYield(_iteratorResult_)). 1. IfAbruptCloseIterator(_completion_, _iterated_). 1. Let _result_ be CreateIteratorFromClosure(_closure_, *"Iterator Helper"*, %IteratorHelperPrototype%, « [[UnderlyingIterator]] »). 1. Set _result_.[[UnderlyingIterator]] to _iterated_.