@@ -11783,6 +11783,33 @@ for the interface.
11783
11783
The \[[Prototype]] [=internal slot=] of an [=iterator prototype object=]
11784
11784
must be {{%IteratorPrototype%}}.
11785
11785
11786
+ <div algorithm>
11787
+ The <dfn>iterator result</dfn> for a pair of IDL values |pair| and a kind |kind| is given by the
11788
+ following steps:
11789
+
11790
+ 1. Let |result| be a value determined by the value of |kind|:
11791
+ <dl class="switch">
11792
+ : "<code>key</code>"
11793
+ :: 1. Let |idlKey| be |pair|’s key.
11794
+ 1. Let |key| be the result of [=converted to an ECMAScript value|converting=] |idlKey| to an ECMAScript value.
11795
+ 1. |result| is |key|.
11796
+ : "<code>value</code>"
11797
+ :: 1. Let |idlValue| be |pair|’s value.
11798
+ 1. Let |value| be the result of [=converted to an ECMAScript value|converting=] |idlValue| to an ECMAScript value.
11799
+ 1. |result| is |value|.
11800
+ : "<code>key+value</code>"
11801
+ :: 1. Let |idlKey| be |pair|’s key.
11802
+ 1. Let |idlValue| be |pair|’s value.
11803
+ 1. Let |key| be the result of [=converted to an ECMAScript value|converting=] |idlKey| to an ECMAScript value.
11804
+ 1. Let |value| be the result of [=converted to an ECMAScript value|converting=] |idlValue| to an ECMAScript value.
11805
+ 1. Let |array| be the result of performing [$ArrayCreate$](2).
11806
+ 1. Call [$CreateDataProperty$](|array|, "<code>0</code>", |key|).
11807
+ 1. Call [$CreateDataProperty$](|array|, "<code>1</code>", |value|).
11808
+ 1. |result| is |array|.
11809
+ </dl>
11810
+ 1. Return [$CreateIterResultObject$](|result|, <emu-val>false</emu-val>).
11811
+ </div>
11812
+
11786
11813
<div algorithm="to invoke the next property of iterators">
11787
11814
11788
11815
An [=iterator prototype object=] must have a <code class="idl">next</code> data property with attributes
@@ -11807,27 +11834,7 @@ must be {{%IteratorPrototype%}}.
11807
11834
return <a abstract-op>CreateIterResultObject</a>(<emu-val>undefined</emu-val>, <emu-val>true</emu-val>).
11808
11835
1. Let |pair| be the entry in |values| at index |index|.
11809
11836
1. Set |object|’s index to |index| + 1.
11810
- 1. Let |result| be a value determined by the value of |kind|:
11811
- <dl class="switch">
11812
- : "<code>key</code>"
11813
- :: 1. Let |idlKey| be |pair|’s key.
11814
- 1. Let |key| be the result of [=converted to an ECMAScript value|converting=] |idlKey| to an ECMAScript value.
11815
- 1. |result| is |key|.
11816
- : "<code>value</code>"
11817
- :: 1. Let |idlValue| be |pair|’s value.
11818
- 1. Let |value| be the result of [=converted to an ECMAScript value|converting=] |idlValue| to an ECMAScript value.
11819
- 1. |result| is |value|.
11820
- : "<code>key+value</code>"
11821
- :: 1. Let |idlKey| be |pair|’s key.
11822
- 1. Let |idlValue| be |pair|’s value.
11823
- 1. Let |key| be the result of [=converted to an ECMAScript value|converting=] |idlKey| to an ECMAScript value.
11824
- 1. Let |value| be the result of [=converted to an ECMAScript value|converting=] |idlValue| to an ECMAScript value.
11825
- 1. Let |array| be the result of performing <a abstract-op>ArrayCreate</a>(2).
11826
- 1. Call <a abstract-op>CreateDataProperty</a>(|array|, "<code>0</code>", |key|).
11827
- 1. Call <a abstract-op>CreateDataProperty</a>(|array|, "<code>1</code>", |value|).
11828
- 1. |result| is |array|.
11829
- </dl>
11830
- 1. Return <a abstract-op>CreateIterResultObject</a>(|result|, <emu-val>false</emu-val>).
11837
+ 1. Return the [=iterator result=] for |pair| and |kind|.
11831
11838
</div>
11832
11839
11833
11840
The [=class string=] of an [=iterator prototype object=] for a given [=interface=]
0 commit comments