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 19, 2024
1 parent fc4354b commit 322876c
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 @@ -46578,7 +46578,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 @@ -46733,10 +46733,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 @@ -46776,7 +46776,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 @@ -46820,7 +46820,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 @@ -46874,7 +46874,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 @@ -46945,11 +46945,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 322876c

Please sign in to comment.