- From: Timothy Gu <notifications@github.com>
- Date: Wed, 25 Mar 2020 11:40:04 -0700
- To: heycam/webidl <webidl@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <heycam/webidl/pull/862/review/381428494@github.com>
@TimothyGu commented on this pull request.
Looks great!
> - with |object| as its [=default asynchronous iterator object/target=],
- "<code>value</code>" as its [=default asynchronous iterator object/kind=], and
- [=default asynchronous iterator object/is finished=] set to false.
- 1. Run the [=asynchronous iterator initialization steps=] for |interface| with |object| and
- |iterator|, if any such steps exist.
- 1. Return |iterator|.
+<div algorithm>
+ To <dfn oldids="es-iterable-entries,es-iterable-keys,es-iterable-values">define the iteration methods</dfn>
+ of [=interface=] |definition| on |target|, given [=Realm=] |realm|, run the following steps:
+
+ 1. If |definition| has an [=indexed property getter=], then:
+ 1. Perform [=!=] [$CreateMethodProperty$](|target|, {{@@iterator}},
+ {{%ArrayProto_values%}}).
+ 1. If |definition| has a [=value iterator=], then:
+ 1. Perform [=!=] [$CreateDataProperty$](|target|, "<code>entries</code>",
+ {{%ArrayProto_values%}}).
```suggestion
{{%ArrayProto_entries%}}).
```
> + of [=interface=] |definition| on |target|, given [=Realm=] |realm|, run the following steps:
+
+ 1. If |definition| has an [=indexed property getter=], then:
+ 1. Perform [=!=] [$CreateMethodProperty$](|target|, {{@@iterator}},
+ {{%ArrayProto_values%}}).
+ 1. If |definition| has a [=value iterator=], then:
+ 1. Perform [=!=] [$CreateDataProperty$](|target|, "<code>entries</code>",
+ {{%ArrayProto_values%}}).
+ 1. Perform [=!=] [$CreateDataProperty$](|target|, "<code>keys</code>",
+ {{%ArrayProto_keys%}}).
+ 1. Perform [=!=] [$CreateDataProperty$](|target|, "<code>values</code>",
+ {{%ArrayProto_values%}}).
+ 1. Perform [=!=] [$CreateDataProperty$](|target|, "<code>forEach</code>",
+ {{%ArrayProto_forEach%}}).
+ 1. Otherwise, if |definition| has a [=pair iterator=], then:
+ 1. Define the {{@@iterator}} and <code>entries</code> methods:
nit: `<code class="idl">entries</code>`; here and below.
Essentially all `<code>` that refers to an identifier and not a string should have `class=idl`.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/pull/862#pullrequestreview-381428494
Received on Wednesday, 25 March 2020 18:40:18 UTC