Skip to content

Commit f2b124e

Browse files
authored
Update 'Creating a sequence from an iterable' to use new iterator AOs
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.
1 parent ca9d63d commit f2b124e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

index.bs

+4-5
Original file line numberDiff line numberDiff line change
@@ -7984,20 +7984,19 @@ JavaScript Array values.
79847984
given an iterable |iterable| and an iterator getter |method|,
79857985
perform the following steps:
79867986

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

0 commit comments

Comments
 (0)