Skip to content

Commit

Permalink
Change built-in iterators' calls to ? Yield inside ACs to ! Generator…
Browse files Browse the repository at this point in the history
…Yield
  • Loading branch information
syg committed Dec 9, 2021
1 parent a24017b commit 979f09f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -7201,7 +7201,7 @@ <h1>
<emu-alg>
1. Let _closure_ be a new Abstract Closure with no parameters that captures _list_ and performs the following steps when called:
1. For each element _E_ of _list_, do
1. Perform ? Yield(_E_).
1. Perform ? GeneratorYield(_E_).
1. Return *undefined*.
1. Let _iterator_ be ! CreateIteratorFromClosure(_closure_, ~empty~, %IteratorPrototype%).
1. Return Record { [[Iterator]]: _iterator_, [[NextMethod]]: %GeneratorFunction.prototype.prototype.next%, [[Done]]: *false* }.
Expand Down Expand Up @@ -34360,7 +34360,7 @@ <h1>String.prototype [ @@iterator ] ( )</h1>
1. Let _nextIndex_ be _position_ + _cp_.[[CodeUnitCount]].
1. Let _resultString_ be the substring of _s_ from _position_ to _nextIndex_.
1. Set _position_ to _nextIndex_.
1. Perform ? Yield(_resultString_).
1. Perform ? GeneratorYield(_resultString_).
1. Return *undefined*.
1. Return ! CreateIteratorFromClosure(_closure_, *"%StringIteratorPrototype%"*, %StringIteratorPrototype%).
</emu-alg>
Expand Down Expand Up @@ -36627,14 +36627,14 @@ <h1>
1. Let _match_ be ? RegExpExec(_R_, _S_).
1. If _match_ is *null*, return *undefined*.
1. If _global_ is *false*, then
1. Perform ? Yield(_match_).
1. Perform ? GeneratorYield(_match_).
1. Return *undefined*.
1. Let _matchStr_ be ? ToString(? Get(_match_, *"0"*)).
1. If _matchStr_ is the empty String, then
1. Let _thisIndex_ be ℝ(? ToLength(? Get(_R_, *"lastIndex"*))).
1. Let _nextIndex_ be ! AdvanceStringIndex(_S_, _thisIndex_, _fullUnicode_).
1. Perform ? Set(_R_, *"lastIndex"*, 𝔽(_nextIndex_), *true*).
1. Perform ? Yield(_match_).
1. Perform ? GeneratorYield(_match_).
1. Return ! CreateIteratorFromClosure(_closure_, *"%RegExpStringIteratorPrototype%"*, %RegExpStringIteratorPrototype%).
</emu-alg>
</emu-clause>
Expand Down Expand Up @@ -38025,14 +38025,14 @@ <h1>
1. Else,
1. Let _len_ be ? LengthOfArrayLike(_array_).
1. If _index_ &ge; _len_, return *undefined*.
1. If _kind_ is ~key~, perform ? Yield(𝔽(_index_)).
1. If _kind_ is ~key~, perform ? GeneratorYield(𝔽(_index_)).
1. Else,
1. Let _elementKey_ be ! ToString(𝔽(_index_)).
1. Let _elementValue_ be ? Get(_array_, _elementKey_).
1. If _kind_ is ~value~, perform ? Yield(_elementValue_).
1. If _kind_ is ~value~, perform ? GeneratorYield(_elementValue_).
1. Else,
1. Assert: _kind_ is ~key+value~.
1. Perform ? Yield(! CreateArrayFromList(&laquo; 𝔽(_index_), _elementValue_ &raquo;)).
1. Perform ? GeneratorYield(! CreateArrayFromList(&laquo; 𝔽(_index_), _elementValue_ &raquo;)).
1. Set _index_ to _index_ + 1.
1. Return ! CreateIteratorFromClosure(_closure_, *"%ArrayIteratorPrototype%"*, %ArrayIteratorPrototype%).
</emu-alg>
Expand Down Expand Up @@ -39835,7 +39835,7 @@ <h1>
1. Else,
1. Assert: _kind_ is ~key+value~.
1. Let _result_ be ! CreateArrayFromList(&laquo; _e_.[[Key]], _e_.[[Value]] &raquo;).
1. Perform ? Yield(_result_).
1. Perform ? GeneratorYield(_result_).
1. NOTE: The number of elements in _entries_ may have changed while execution of this abstract operation was paused by Yield.
1. Set _numEntries_ to the number of elements of _entries_.
1. Return *undefined*.
Expand Down Expand Up @@ -40120,10 +40120,10 @@ <h1>
1. Set _index_ to _index_ + 1.
1. If _e_ is not ~empty~, then
1. If _kind_ is ~key+value~, then
1. Perform ? Yield(! CreateArrayFromList(&laquo; _e_, _e_ &raquo;)).
1. Perform ? GeneratorYield(! CreateArrayFromList(&laquo; _e_, _e_ &raquo;)).
1. Else,
1. Assert: _kind_ is ~value~.
1. Perform ? Yield(_e_).
1. Perform ? GeneratorYield(_e_).
1. NOTE: The number of elements in _entries_ may have changed while execution of this abstract operation was paused by Yield.
1. Set _numEntries_ to the number of elements of _entries_.
1. Return *undefined*.
Expand Down

0 comments on commit 979f09f

Please sign in to comment.