Skip to content

Commit ab632ac

Browse files
authored
Editorial: link to Infra for "For each" (#69)
Use "For each" from Infra and explicitly specify a variable to iterate over.
1 parent 66dae67 commit ab632ac

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

index.bs

+8-8
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,16 @@ The <dfn>compress and enqueue a chunk</dfn> algorithm, given a {{CompressionStre
9494
1. If |chunk| is not a {{BufferSource}} type, then throw a {{TypeError}}.
9595
1. Let |buffer| be the result of compressing |chunk| with |cs|'s <a for=CompressionStream>format</a> and <a for=CompressionStream>context</a>.
9696
1. If |buffer| is empty, return.
97-
1. Split |buffer| into one or more non-empty pieces and convert them into {{Uint8Array}}s.
98-
1. For each {{Uint8Array}} |array|, [=TransformStream/enqueue=] |array| in |cs|'s [=GenericTransformStream/transform=].
97+
1. Let |arrays| be the result of splitting |buffer| into one or more non-empty pieces and converting them into {{Uint8Array}}s.
98+
1. [=list/For each=] {{Uint8Array}} |array| of |arrays|, [=TransformStream/enqueue=] |array| in |cs|'s [=GenericTransformStream/transform=].
9999
</div>
100100

101101
<div algorithm>
102102
The <dfn>compress flush and enqueue</dfn> algorithm, which handles the end of data from the input {{ReadableStream}} object, given a {{CompressionStream}} object |cs|, runs these steps:
103103
1. Let |buffer| be the result of compressing an empty input with |cs|'s <a for=CompressionStream>format</a> and <a for=CompressionStream>context</a>, with the finish flag.
104104
1. If |buffer| is empty, return.
105-
1. Split |buffer| into one or more non-empty pieces and convert them into {{Uint8Array}}s.
106-
1. For each {{Uint8Array}} |array|, [=TransformStream/enqueue=] |array| in |cs|'s [=GenericTransformStream/transform=].
105+
1. Let |arrays| be the result of splitting |buffer| into one or more non-empty pieces and converting them into {{Uint8Array}}s.
106+
1. [=list/For each=] {{Uint8Array}} |array| of |arrays|, [=TransformStream/enqueue=] |array| in |cs|'s [=GenericTransformStream/transform=].
107107
</div>
108108

109109

@@ -134,17 +134,17 @@ The <dfn>decompress and enqueue a chunk</dfn> algorithm, given a {{Decompression
134134
1. If |chunk| is not a {{BufferSource}} type, then throw a {{TypeError}}.
135135
1. Let |buffer| be the result of decompressing |chunk| with |ds|'s <a for=DecompressionStream>format</a> and <a for=DecompressionStream>context</a>. If this results in an error, then throw a {{TypeError}}.
136136
1. If |buffer| is empty, return.
137-
1. Split |buffer| into one or more non-empty pieces and convert them into {{Uint8Array}}s.
138-
1. For each {{Uint8Array}} |array|, [=TransformStream/enqueue=] |array| in |ds|'s [=GenericTransformStream/transform=].
137+
1. Let |arrays| be the result of splitting |buffer| into one or more non-empty pieces and converting them into {{Uint8Array}}s.
138+
1. [=list/For each=] {{Uint8Array}} |array| of |arrays|, [=TransformStream/enqueue=] |array| in |ds|'s [=GenericTransformStream/transform=].
139139
</div>
140140

141141
<div algorithm>
142142
The <dfn>decompress flush and enqueue</dfn> algorithm, which handles the end of data from the input {{ReadableStream}} object, given a {{DecompressionStream}} object |ds|, runs these steps:
143143
1. Let |buffer| be the result of decompressing an empty input with |ds|'s <a for=DecompressionStream>format</a> and <a for=DecompressionStream>context</a>, with the finish flag.
144144
1. If the end of the compressed input has not been reached, then throw a {{TypeError}}.
145145
1. If |buffer| is empty, return.
146-
1. Split |buffer| into one or more non-empty pieces and convert them into {{Uint8Array}}s.
147-
1. For each {{Uint8Array}} |array|, [=TransformStream/enqueue=] |array| in |ds|'s [=GenericTransformStream/transform=].
146+
1. Let |arrays| be the result of splitting |buffer| into one or more non-empty pieces and converting them into {{Uint8Array}}s.
147+
1. [=list/For each=] {{Uint8Array}} |array| of |arrays|, [=TransformStream/enqueue=] |array| in |ds|'s [=GenericTransformStream/transform=].
148148
</div>
149149

150150

0 commit comments

Comments
 (0)