From 1da2e097629ff26a0dc8019eccf18324bcc939ef Mon Sep 17 00:00:00 2001 From: Denis Pushkarev Date: Thu, 14 Jul 2022 00:50:17 +0700 Subject: [PATCH 1/2] add `Iterator.prototype.toAsync` --- spec.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec.html b/spec.html index 64255a6..3b28ff5 100644 --- a/spec.html +++ b/spec.html @@ -603,6 +603,17 @@

Iterator.prototype.toArray ( )

+ +

Iterator.prototype.toAsync ( )

+ + 1. Let _syncIteratorRecord_ be ? GetIteratorDirect(*this* value). + 1. Let _asyncIteratorRecord_ to CreateAsyncFromSyncIterator(_syncIteratorRecord_). + 1. Let _wrapper_ be ! ObjectCreate(%WrapForValidAsyncIteratorPrototype%, « [[AsyncIterated]] »). + 1. Set _wrapper_.[[AsyncIterated]] to _asyncIteratorRecord_. + 1. Return _wrapper_. + +
+

Iterator.prototype.forEach ( _fn_ )

From a37806bc655e18de116d42b0280ac3486ff7839d Mon Sep 17 00:00:00 2001 From: Denis Pushkarev Date: Wed, 20 Jul 2022 04:22:49 +0700 Subject: [PATCH 2/2] Update spec.html Co-authored-by: Michael Ficarra --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index 3b28ff5..c8c7d7f 100644 --- a/spec.html +++ b/spec.html @@ -607,7 +607,7 @@

Iterator.prototype.toArray ( )

Iterator.prototype.toAsync ( )

1. Let _syncIteratorRecord_ be ? GetIteratorDirect(*this* value). - 1. Let _asyncIteratorRecord_ to CreateAsyncFromSyncIterator(_syncIteratorRecord_). + 1. Let _asyncIteratorRecord_ be CreateAsyncFromSyncIterator(_syncIteratorRecord_). 1. Let _wrapper_ be ! ObjectCreate(%WrapForValidAsyncIteratorPrototype%, « [[AsyncIterated]] »). 1. Set _wrapper_.[[AsyncIterated]] to _asyncIteratorRecord_. 1. Return _wrapper_.