Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -48086,6 +48086,36 @@ <h1>Properties of the Iterator Constructor</h1>
<li>has the following properties:</li>
</ul>

<emu-clause id="sec-iterator.concat">
<h1>Iterator.concat ( ..._items_ )</h1>
<emu-alg>
1. Let _iterables_ be a new empty List.
1. For each element _item_ of _items_, do
1. If _item_ is not an Object, throw a *TypeError* exception.
1. Let _method_ be ? GetMethod(_item_, %Symbol.iterator%).
1. If _method_ is *undefined*, throw a *TypeError* exception.
Comment on lines +48095 to +48096
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps these two steps, which are repeated in GetIterator, could be abstracted to a reused AO?

1. Append the Record { [[OpenMethod]]: _method_, [[Iterable]]: _item_ } to _iterables_.
1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterables_ and performs the following steps when called:
1. For each Record _iterable_ of _iterables_, do
1. Let _iter_ be ? Call(_iterable_.[[OpenMethod]], _iterable_.[[Iterable]]).
1. If _iter_ is not an Object, throw a *TypeError* exception.
1. Let _iteratorRecord_ be ? GetIteratorDirect(_iter_).
1. Let _innerAlive_ be *true*.
1. Repeat, while _innerAlive_ is *true*,
1. Let _innerValue_ be ? IteratorStepValue(_iteratorRecord_).
1. If _innerValue_ is ~done~, then
1. Set _innerAlive_ to *false*.
1. Else,
1. Let _completion_ be Completion(Yield(_innerValue_)).
1. If _completion_ is an abrupt completion, then
1. Return ? IteratorClose(_iteratorRecord_, _completion_).
1. Return ReturnCompletion(*undefined*).
1. Let _gen_ be CreateIteratorFromClosure(_closure_, *"Iterator Helper"*, %IteratorHelperPrototype%, « [[UnderlyingIterators]] »).
1. Set _gen_.[[UnderlyingIterators]] to a new empty List.
1. Return _gen_.
</emu-alg>
</emu-clause>

<emu-clause id="sec-iterator.from">
<h1>Iterator.from ( _O_ )</h1>
<emu-alg>
Expand Down
Loading