From bebe10d77c7a82989ee4ee6c3a8f3916f3db2907 Mon Sep 17 00:00:00 2001 From: Dominic Farolino Date: Fri, 28 Feb 2025 15:09:19 -0500 Subject: [PATCH] Call Subscriber's next method for async iterators (#202) --- spec.bs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spec.bs b/spec.bs index a6e3845..8e3fc7a 100644 --- a/spec.bs +++ b/spec.bs @@ -548,7 +548,14 @@ An internal observer is a [=struct=] with the following [=struct/item 1. If |done|'s \[[Value]] is true, then run |subscriber|'s {{Subscriber/complete()}} and abort these steps. - 1. Run |nextAlgorithm|. + 1. Let |value| be [$IteratorValue$](|iteratorResult|). + + 1. If |value| is a [=throw completion=], then run |subscriber|'s + {{Subscriber/error()}} method with |value|'s \[[Value]] and abort these steps. + + 1. Run |subscriber|'s {{Subscriber/next()}} given |value|'s \[[Value]]. + + 1. Run |nextAlgorithm| given |subscriber| and |iteratorRecord|. * If |nextPromise| was rejected with reason |r|, then run |subscriber|'s {{Subscriber/error()}} method given |r|.