Skip to content

Commit 278c48b

Browse files
Ms2germfalken
authored andcommitted
Editorial: Update 'wait for all' usage. (#1463)
Fixes #1363. Fixes #1461. The authors of this commit are Ms2ger and Jake Archibald.
1 parent 4783e9d commit 278c48b

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

docs/index.bs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,7 +1862,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
18621862

18631863
1. Let |requests| be an array containing only |request|.
18641864
1. Let |responseArrayPromise| be the result of running the algorithm specified in {{Cache/addAll(requests)}} passing |requests| as the argument.
1865-
1. Return the result of [=transforming=] |responseArrayPromise| with a fulfillment handler that returns undefined.
1865+
1. Return the result of [=upon settling|transforming=] |responseArrayPromise| with a fulfillment handler that returns undefined.
18661866
</section>
18671867

18681868
<section algorithm="cache-addAll">
@@ -1903,8 +1903,8 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
19031903
Note: The cache commit is allowed when the response's body is fully received.
19041904

19051905
1. Add |responsePromise| to |responsePromises|.
1906-
1. Let |p| be [=waiting for all=] of |responsePromises|.
1907-
1. Return the result of [=transforming=] |p| with a fulfillment handler that, when called with argument |responses|, performs the following substeps:
1906+
1. Let |p| be the result of [=getting a promise to wait for all=] of |responsePromises|.
1907+
1. Return the result of [=upon settling|transforming=] |p| with a fulfillment handler that, when called with argument |responses|, performs the following substeps:
19081908
1. Let |operations| be an empty [=list=].
19091909
1. Let |index| be zero.
19101910
1. For each |response| in |responses|:
@@ -2071,7 +2071,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
20712071
1. Else:
20722072
1. Let |promise| be [=a promise resolved with=] undefined.
20732073
1. [=map/For each=] <var ignore>cacheName</var> → |cache| of the [=relevant name to cache map=]:
2074-
1. Set |promise| to the result of [=transforming=] itself with a fulfillment handler that, when called with argument |response|, performs the following substeps:
2074+
1. Set |promise| to the result of [=upon settling|transforming=] itself with a fulfillment handler that, when called with argument |response|, performs the following substeps:
20752075
1. If |response| is not undefined, return |response|.
20762076
1. Return the result of running the algorithm specified in {{Cache/match(request, options)}} method of {{Cache}} interface with |request| and |options| as the arguments (providing |cache| as thisArgument to the `[[Call]]` internal method of {{Cache/match(request, options)}}.)
20772077
1. Return |promise|.
@@ -2113,7 +2113,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
21132113
<dfn method for="CacheStorage"><code>delete(|cacheName|)</code></dfn> method *must* run these steps:
21142114

21152115
1. Let |promise| be the result of running the algorithm specified in {{CacheStorage/has(cacheName)}} method with |cacheName|.
2116-
1. Return the result of [=transforming=] |promise| with a fulfillment handler that, when called with argument |cacheExists|, performs the following substeps:
2116+
1. Return the result of [=upon settling|transforming=] |promise| with a fulfillment handler that, when called with argument |cacheExists|, performs the following substeps:
21172117
1. If |cacheExists| is false, then:
21182118
1. Return false.
21192119
1. Let |cacheJobPromise| be [=a new promise=].
@@ -2725,7 +2725,9 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
27252725
1. <a>Dispatch</a> |e| at |installingWorker|'s [=service worker/global object=].
27262726
1. *WaitForAsynchronousExtensions*: Run the following substeps <a>in parallel</a>:
27272727
1. <span id="install-settle-step">Wait until |e| is not [=ExtendableEvent/active=].</span>
2728-
1. If |e|'s [=ExtendableEvent/timed out flag=] is set, or the result of [=waiting for all=] of |e|'s [=extend lifetime promises=] rejected, set |installFailed| to true.
2728+
1. If |e|'s [=ExtendableEvent/timed out flag=] is set, set |installFailed| to true.
2729+
1. Let |p| be the result of [=getting a promise to wait for all=] of |e|'s [=extend lifetime promises=].
2730+
1. [=Upon rejection=] of |p|, set |installFailed| to true.
27292731

27302732
If |task| is discarded, set |installFailed| to true.
27312733

docs/v1/index.bs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,7 +1743,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
17431743

17441744
1. Let |requests| be an array containing only |request|.
17451745
1. Let |responseArrayPromise| be the result of running the algorithm specified in {{Cache/addAll(requests)}} passing |requests| as the argument.
1746-
1. Return the result of [=transforming=] |responseArrayPromise| with a fulfillment handler that returns undefined.
1746+
1. Return the result of [=upon settling|transforming=] |responseArrayPromise| with a fulfillment handler that returns undefined.
17471747
</section>
17481748

17491749
<section algorithm="cache-addAll">
@@ -1784,8 +1784,8 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
17841784
Note: The cache commit is allowed when the response's body is fully received.
17851785

17861786
1. Add |responsePromise| to |responsePromises|.
1787-
1. Let |p| be [=waiting for all=] of |responsePromises|.
1788-
1. Return the result of [=transforming=] |p| with a fulfillment handler that, when called with argument |responses|, performs the following substeps:
1787+
1. Let |p| be the result of [=getting a promise to wait for all=] of |responsePromises|.
1788+
1. Return the result of [=upon settling|transforming=] |p| with a fulfillment handler that, when called with argument |responses|, performs the following substeps:
17891789
1. Let |operations| be an empty [=list=].
17901790
1. Let |index| be zero.
17911791
1. For each |response| in |responses|:
@@ -1949,7 +1949,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
19491949
1. Else:
19501950
1. Let |promise| be [=a promise resolved with=] undefined.
19511951
1. [=map/For each=] <var ignore>cacheName</var> → |cache| of the [=relevant name to cache map=]:
1952-
1. Set |promise| to the result of [=transforming=] itself with a fulfillment handler that, when called with argument |response|, performs the following substeps:
1952+
1. Set |promise| to the result of [=upon settling|transforming=] itself with a fulfillment handler that, when called with argument |response|, performs the following substeps:
19531953
1. If |response| is not undefined, return |response|.
19541954
1. Return the result of running the algorithm specified in {{Cache/match(request, options)}} method of {{Cache}} interface with |request| and |options| as the arguments (providing |cache| as thisArgument to the `[[Call]]` internal method of {{Cache/match(request, options)}}.)
19551955
1. Return |promise|.
@@ -1991,7 +1991,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
19911991
<dfn method for="CacheStorage"><code>delete(|cacheName|)</code></dfn> method *must* run these steps:
19921992

19931993
1. Let |promise| be the result of running the algorithm specified in {{CacheStorage/has(cacheName)}} method with |cacheName|.
1994-
1. Return the result of [=transforming=] |promise| with a fulfillment handler that, when called with argument |cacheExists|, performs the following substeps:
1994+
1. Return the result of [=upon settling|transforming=] |promise| with a fulfillment handler that, when called with argument |cacheExists|, performs the following substeps:
19951995
1. If |cacheExists| is false, then:
19961996
1. Return false.
19971997
1. Let |cacheJobPromise| be [=a new promise=].
@@ -2541,7 +2541,9 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
25412541
1. <a>Dispatch</a> |e| at |installingWorker|'s [=service worker/global object=].
25422542
1. *WaitForAsynchronousExtensions*: Run the following substeps <a>in parallel</a>:
25432543
1. <span id="install-settle-step">Wait until |e| is not [=ExtendableEvent/active=].</span>
2544-
1. If |e|'s [=ExtendableEvent/timed out flag=] is set, or the result of [=waiting for all=] of |e|'s [=extend lifetime promises=] rejected, set |installFailed| to true.
2544+
1. If |e|'s [=ExtendableEvent/timed out flag=] is set, set |installFailed| to true.
2545+
1. Let |p| be the result of [=getting a promise to wait for all=] of |e|'s [=extend lifetime promises=].
2546+
1. [=Upon rejection=] of |p|, set |installFailed| to true.
25452547

25462548
If |task| is discarded, set |installFailed| to true.
25472549

0 commit comments

Comments
 (0)