From 58a9fa59291e28e33f20bcbfd0d68cec3e1d3c91 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Fri, 26 Sep 2025 16:49:24 +0200 Subject: [PATCH 1/2] Explicitly call out what to do on the end of the compressed input --- index.bs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.bs b/index.bs index 12d0647..138c23a 100644 --- a/index.bs +++ b/index.bs @@ -139,15 +139,16 @@ The decompress and enqueue a chunk algorithm, given a {{Decompression 1. If |buffer| is empty, return. 1. Let |arrays| be the result of splitting |buffer| into one or more non-empty pieces and converting them into {{Uint8Array}}s. 1. [=list/For each=] {{Uint8Array}} |array| of |arrays|, [=TransformStream/enqueue=] |array| in |ds|'s [=GenericTransformStream/transform=]. + 1. If the end of the compressed input has been reached, and [=DecompressionStream/context=] has not fully consumed |chunk|, then throw a {{TypeError}}.
The decompress flush and enqueue algorithm, which handles the end of data from the input {{ReadableStream}} object, given a {{DecompressionStream}} object |ds|, runs these steps: 1. Let |buffer| be the result of decompressing an empty input with |ds|'s format and context, with the finish flag. + 1. If |buffer| is not empty: + 1. Let |arrays| be the result of splitting |buffer| into one or more non-empty pieces and converting them into {{Uint8Array}}s. + 1. [=list/For each=] {{Uint8Array}} |array| of |arrays|, [=TransformStream/enqueue=] |array| in |ds|'s [=GenericTransformStream/transform=]. 1. If the end of the compressed input has not been reached, then throw a {{TypeError}}. - 1. If |buffer| is empty, return. - 1. Let |arrays| be the result of splitting |buffer| into one or more non-empty pieces and converting them into {{Uint8Array}}s. - 1. [=list/For each=] {{Uint8Array}} |array| of |arrays|, [=TransformStream/enqueue=] |array| in |ds|'s [=GenericTransformStream/transform=].
From 39ab58b6c67764f5a7cc0ae8627903fc5bfe8f69 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Fri, 26 Sep 2025 17:17:55 +0200 Subject: [PATCH 2/2] ds's --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index 138c23a..3ddd304 100644 --- a/index.bs +++ b/index.bs @@ -139,7 +139,7 @@ The decompress and enqueue a chunk algorithm, given a {{Decompression 1. If |buffer| is empty, return. 1. Let |arrays| be the result of splitting |buffer| into one or more non-empty pieces and converting them into {{Uint8Array}}s. 1. [=list/For each=] {{Uint8Array}} |array| of |arrays|, [=TransformStream/enqueue=] |array| in |ds|'s [=GenericTransformStream/transform=]. - 1. If the end of the compressed input has been reached, and [=DecompressionStream/context=] has not fully consumed |chunk|, then throw a {{TypeError}}. + 1. If the end of the compressed input has been reached, and |ds|'s [=DecompressionStream/context=] has not fully consumed |chunk|, then throw a {{TypeError}}.