Skip to content

Commit 400ce04

Browse files
Update ongoing promise in async iterator return() method
This aligns with the behavior of async generators.
1 parent 47c5c92 commit 400ce04

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

index.bs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12794,27 +12794,27 @@ The \[[Prototype]] [=/internal slot=] of an [=asynchronous iterator prototype ob
1279412794
|interface|, given |object|'s [=default asynchronous iterator object/target=], |object|,
1279512795
and |value|.
1279612796

12797-
1. Let |returnStepsPromise| be null.
12798-
1279912797
1. Let |ongoingPromise| be |object|'s [=default asynchronous iterator object/ongoing promise=].
1280012798

1280112799
1. If |ongoingPromise| is not null, then:
1280212800
1. Let |afterOngoingPromiseCapability| be [=!=] [$NewPromiseCapability$]({{%Promise%}}).
1280312801
1. Let |onSettled| be [$CreateBuiltinFunction$](|returnSteps|, « »).
1280412802
1. Perform [$PerformPromiseThen$](|ongoingPromise|, |onSettled|, |onSettled|,
1280512803
|afterOngoingPromiseCapability|).
12806-
1. Set |returnStepsPromise| to |afterOngoingPromiseCapability|.\[[Promise]].
12804+
1. Set |object|'s [=default asynchronous iterator object/ongoing promise=] to
12805+
|afterOngoingPromiseCapability|.\[[Promise]].
1280712806

1280812807
1. Otherwise:
12809-
1. Set |returnStepsPromise| to the result of running |returnSteps|.
12808+
1. Set |object|'s [=default asynchronous iterator object/ongoing promise=] to the result of
12809+
running |returnSteps|.
1281012810

1281112811
1. Let |fulfillSteps| be the following steps:
1281212812
1. Return [$CreateIterResultObject$](|value|, <emu-val>true</emu-val>).
1281312813

1281412814
1. Let |onFulfilled| be [$CreateBuiltinFunction$](|fulfillSteps|, « »).
1281512815

12816-
1. Perform [$PerformPromiseThen$](|returnStepsPromise|, |onFulfilled|,
12817-
<emu-val>undefined</emu-val>, |returnPromiseCapability|).
12816+
1. Perform [$PerformPromiseThen$](|object|'s [=default asynchronous iterator object/ongoing
12817+
promise=], |onFulfilled|, <emu-val>undefined</emu-val>, |returnPromiseCapability|).
1281812818

1281912819
1. Return |returnPromiseCapability|.\[[Promise]].
1282012820
</div>

0 commit comments

Comments
 (0)