Skip to content

Commit

Permalink
Update 'Creating a sequence from an iterable' to use new iterator AOs
Browse files Browse the repository at this point in the history
GetIterator no longer exists in this form (it tries to obtain the method when passed sync or async), and IteratorStep/IteratorValue have been merged into a single AO for convenience.
  • Loading branch information
linusg authored Jun 10, 2024
1 parent ca9d63d commit f2b124e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -7984,20 +7984,19 @@ JavaScript Array values.
given an iterable |iterable| and an iterator getter |method|,
perform the following steps:

1. Let |iter| be [=?=] <a abstract-op>GetIterator</a>(|iterable|, <emu-const>sync</emu-const>, |method|).
1. Let |iteratorRecord| be [=?=] <a abstract-op>GetIteratorFromMethod</a>(|iterable|, |method|).
1. Initialize |i| to be 0.
1. Repeat
1. Let |next| be [=?=] <a abstract-op>IteratorStep</a>(|iter|).
1. If |next| is <emu-val>false</emu-val>,
1. Let |next| be [=?=] <a abstract-op>IteratorStepValue</a>(|iteratorRecord|).
1. If |next| is <emu-const>done</emu-const>,
then return an IDL sequence value of type
<a lt="sequence type">sequence&lt;|T|&gt;</a>
of length |i|, where the value of the element
at index |j| is
|S|<sub>|j|</sub>.
1. Let |nextItem| be [=?=] <a abstract-op>IteratorValue</a>(|next|).
1. Initialize |S|<sub>|i|</sub> to the result of
[=converted to an IDL value|converting=]
|nextItem| to an IDL value of type |T|.
|next| to an IDL value of type |T|.
1. Set |i| to |i| + 1.
</div>

Expand Down

0 comments on commit f2b124e

Please sign in to comment.