Skip to content

Commit 78c9237

Browse files
rename enums in GetIteratorFlattenable
also split up the steps and add an assert for better understandability
1 parent 0bf3656 commit 78c9237

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

spec.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7000,14 +7000,16 @@ <h1>
70007000
<h1>
70017001
GetIteratorFlattenable (
70027002
_obj_: an ECMAScript language value,
7003-
_stringHandling_: ~iterate-strings~ or ~reject-strings~,
7003+
_primitiveHandling_: ~iterate-string-primitives~ or ~reject-primitives~,
70047004
): either a normal completion containing an Iterator Record or a throw completion
70057005
</h1>
70067006
<dl class="header">
70077007
</dl>
70087008
<emu-alg>
70097009
1. If _obj_ is not an Object, then
7010-
1. If _stringHandling_ is ~reject-strings~ or _obj_ is not a String, throw a *TypeError* exception.
7010+
1. If _primitiveHandling_ is ~reject-primitives~, throw a *TypeError* exception.
7011+
1. Assert: _primitiveHandling_ is ~iterate-string-primitives~.
7012+
1. If _obj_ is not a String, throw a *TypeError* exception.
70117013
1. Let _method_ be ? GetMethod(_obj_, %Symbol.iterator%).
70127014
1. If _method_ is *undefined*, then
70137015
1. Let _iterator_ be _obj_.
@@ -46574,7 +46576,7 @@ <h1>Iterator.prototype</h1>
4657446576
<emu-clause id="sec-iterator.from">
4657546577
<h1>Iterator.from ( _O_ )</h1>
4657646578
<emu-alg>
46577-
1. Let _iteratorRecord_ be ? GetIteratorFlattenable(_O_, ~iterate-strings~).
46579+
1. Let _iteratorRecord_ be ? GetIteratorFlattenable(_O_, ~iterate-string-primitives~).
4657846580
1. Let _hasInstance_ be ? OrdinaryHasInstance(%Iterator%, _iteratorRecord_.[[Iterator]]).
4657946581
1. If _hasInstance_ is *true*, then
4658046582
1. Return _iteratorRecord_.[[Iterator]].
@@ -46813,7 +46815,7 @@ <h1>Iterator.prototype.flatMap ( _mapper_ )</h1>
4681346815
1. If _value_ is ~done~, return *undefined*.
4681446816
1. Let _mapped_ be Completion(Call(_mapper_, *undefined*, « _value_, 𝔽(_counter_) »)).
4681546817
1. IfAbruptCloseIterator(_mapped_, _iterated_).
46816-
1. Let _innerIterator_ be Completion(GetIteratorFlattenable(_mapped_, ~reject-strings~)).
46818+
1. Let _innerIterator_ be Completion(GetIteratorFlattenable(_mapped_, ~reject-primitives~)).
4681746819
1. IfAbruptCloseIterator(_innerIterator_, _iterated_).
4681846820
1. Let _innerAlive_ be *true*.
4681946821
1. Repeat, while _innerAlive_ is *true*,

0 commit comments

Comments
 (0)