Skip to content

Commit

Permalink
ReturnCompletion(*undefined*) instead of NormalCompletion(~unused~)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelficarra committed Sep 23, 2024
1 parent d4c0e3c commit 380047c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -46605,7 +46605,7 @@ <h1>%IteratorHelperPrototype%.return ( )</h1>
1. If _O_.[[GeneratorState]] is ~suspended-start~, then
1. Set _O_.[[GeneratorState]] to ~completed~.
1. NOTE: Once a generator enters the completed state it never leaves it and its associated execution context is never resumed. Any execution state associated with _O_ can be discarded at this point.
1. Perform ? IteratorClose(_O_.[[UnderlyingIterator]], NormalCompletion(~unused~)).
1. Perform ? IteratorClose(_O_.[[UnderlyingIterator]], ReturnCompletion(*undefined*)).
1. Return CreateIteratorResultObject(*undefined*, *true*).
1. Let _C_ be Completion Record { [[Type]]: ~return~, [[Value]]: *undefined*, [[Target]]: ~empty~ }.
1. Return ? GeneratorResumeAbrupt(_O_, _C_, *"Iterator Helper"*).
Expand Down Expand Up @@ -46760,10 +46760,10 @@ <h1>Iterator.prototype.drop ( _limit_ )</h1>
1. If _remaining_ ≠ +∞, then
1. Set _remaining_ to _remaining_ - 1.
1. Let _next_ be ? IteratorStep(_iterated_).
1. If _next_ is ~done~, return NormalCompletion(~unused~).
1. If _next_ is ~done~, return ReturnCompletion(*undefined*).
1. Repeat,
1. Let _value_ be ? IteratorStepValue(_iterated_).
1. If _value_ is ~done~, return NormalCompletion(~unused~).
1. If _value_ is ~done~, return ReturnCompletion(*undefined*).
1. Let _completion_ be Completion(Yield(_value_)).
1. IfAbruptCloseIterator(_completion_, _iterated_).
1. Let _result_ be CreateIteratorFromClosure(_closure_, *"Iterator Helper"*, %IteratorHelperPrototype%, « [[UnderlyingIterator]] »).
Expand Down Expand Up @@ -46803,7 +46803,7 @@ <h1>Iterator.prototype.filter ( _predicate_ )</h1>
1. Let _counter_ be 0.
1. Repeat,
1. Let _value_ be ? IteratorStepValue(_iterated_).
1. If _value_ is ~done~, return NormalCompletion(~unused~).
1. If _value_ is ~done~, return ReturnCompletion(*undefined*).
1. Let _selected_ be Completion(Call(_predicate_, *undefined*, « _value_, 𝔽(_counter_) »)).
1. IfAbruptCloseIterator(_selected_, _iterated_).
1. If ToBoolean(_selected_) is *true*, then
Expand Down Expand Up @@ -46847,7 +46847,7 @@ <h1>Iterator.prototype.flatMap ( _mapper_ )</h1>
1. Let _counter_ be 0.
1. Repeat,
1. Let _value_ be ? IteratorStepValue(_iterated_).
1. If _value_ is ~done~, return NormalCompletion(~unused~).
1. If _value_ is ~done~, return ReturnCompletion(*undefined*).
1. Let _mapped_ be Completion(Call(_mapper_, *undefined*, « _value_, 𝔽(_counter_) »)).
1. IfAbruptCloseIterator(_mapped_, _iterated_).
1. Let _innerIterator_ be Completion(GetIteratorFlattenable(_mapped_, ~reject-primitives~)).
Expand Down Expand Up @@ -46901,7 +46901,7 @@ <h1>Iterator.prototype.map ( _mapper_ )</h1>
1. Let _counter_ be 0.
1. Repeat,
1. Let _value_ be ? IteratorStepValue(_iterated_).
1. If _value_ is ~done~, return NormalCompletion(~unused~).
1. If _value_ is ~done~, return ReturnCompletion(*undefined*).
1. Let _mapped_ be Completion(Call(_mapper_, *undefined*, « _value_, 𝔽(_counter_) »)).
1. IfAbruptCloseIterator(_mapped_, _iterated_).
1. Let _completion_ be Completion(Yield(_mapped_)).
Expand Down Expand Up @@ -46972,11 +46972,11 @@ <h1>Iterator.prototype.take ( _limit_ )</h1>
1. Let _remaining_ be _integerLimit_.
1. Repeat,
1. If _remaining_ = 0, then
1. Return ? IteratorClose(_iterated_, NormalCompletion(*undefined*)).
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 NormalCompletion(~unused~).
1. If _value_ is ~done~, return ReturnCompletion(*undefined*).
1. Let _completion_ be Completion(Yield(_value_)).
1. IfAbruptCloseIterator(_completion_, _iterated_).
1. Let _result_ be CreateIteratorFromClosure(_closure_, *"Iterator Helper"*, %IteratorHelperPrototype%, « [[UnderlyingIterator]] »).
Expand Down

0 comments on commit 380047c

Please sign in to comment.