@@ -129,12 +129,14 @@ <h1>
129
129
<h1 >
130
130
GetIteratorFlattenable (
131
131
_obj_ : an ECMAScript language value,
132
+ _stringHandling_ : ~iterate-strings~ or ~reject-strings~ ,
132
133
): either a normal completion containing an Iterator Record or a throw completion
133
134
</h1 >
134
135
<dl class =" header" >
135
136
</dl >
136
137
<emu-alg >
137
- 1. If _obj_ is not an Object, throw a *TypeError* exception.
138
+ 1. If _obj_ is not an Object, then
139
+ 1. If _stringHandling_ is ~reject-strings~ or _obj_ is not a String, throw a *TypeError* exception.
138
140
1. Let _method_ be ? GetMethod(_obj_ , @@iterator).
139
141
1. If _method_ is *undefined* , then
140
142
1. Let _iterator_ be _obj_ .
@@ -187,8 +189,7 @@ <h1>Iterator.prototype</h1>
187
189
<emu-clause id =" sec-iterator.from" >
188
190
<h1 >Iterator.from ( _O_ )</h1 >
189
191
<emu-alg >
190
- 1. If _O_ is a String, set _O_ to ! ToObject(_O_ ).
191
- 1. Let _iteratorRecord_ be ? GetIteratorFlattenable(_O_ ).
192
+ 1. Let _iteratorRecord_ be ? GetIteratorFlattenable(_O_ , ~iterate-strings~ ).
192
193
1. Let _hasInstance_ be ? OrdinaryHasInstance(%Iterator%, _iteratorRecord_ .[[Iterator]]).
193
194
1. If _hasInstance_ is *true* , then
194
195
1. Return _iteratorRecord_ .[[Iterator]].
@@ -415,7 +416,7 @@ <h1>Iterator.prototype.flatMap ( _mapper_ )</h1>
415
416
1. Let _value_ be ? IteratorValue(_next_ ).
416
417
1. Let _mapped_ be Completion(Call(_mapper_ , *undefined* , « _value_ , 𝔽(_counter_ ) »)).
417
418
1. IfAbruptCloseIterator(_mapped_ , _iterated_ ).
418
- 1. Let _innerIterator_ be Completion(GetIteratorFlattenable(_mapped_ )).
419
+ 1. Let _innerIterator_ be Completion(GetIteratorFlattenable(_mapped_ , ~reject-strings~ )).
419
420
1. IfAbruptCloseIterator(_innerIterator_ , _iterated_ ).
420
421
1. Let _innerAlive_ be *true* .
421
422
1. Repeat, while _innerAlive_ is *true* ,
0 commit comments