- From: Mattias Buelens <notifications@github.com>
- Date: Tue, 19 May 2026 05:47:36 -0700
- To: whatwg/fetch <fetch@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/fetch/pull/1862/review/4319017720@github.com>
@MattiasBuelens commented on this pull request.
> @@ -8246,6 +8250,20 @@ of running <a for=Body>consume body</a> with <a>this</a> and <a>parse JSON from
of running <a for=Body>consume body</a> with <a>this</a> and <a>UTF-8 decode</a>.
</div>
+<div algorithm>
+<p>The <dfn method for=Body><code>textStream()</code></dfn> method steps are:</p>
+
+<ol>
+ <li><p>If <span>this</span>'s <a for=Body>body</a> is null, throw a {{TypeError}}.
+
+ <li><p>Let <var>stream</var> be <a>this</a>'s <a for=Body>body</a>'s <a for=body>stream</a>.
+
+ <li><p>Let <var>decoder</var> be a new {{TextDecoderStream}} object.
We can still use `TextDecoderStream`, that's not the problem. The question is rather: what is the "correct" wording to create it and call [its specified constructor](https://encoding.spec.whatwg.org/#dom-textdecoderstream)?
Web IDL seems to assume that constructor operations are only intended to be called by the JavaScript binding, not by other specifications. That's why we came up with the ["create + setup" pattern for `ReadableStream`](https://streams.spec.whatwg.org/#readablestream-set-up), since those only use exported *algorithms* instead of *operations*.
I agree that it would be cumbersome to create both an "algorithm" and "constructor operation" version of every constructor, just to satisfy both use cases. If there's already an agreed-upon way for specifications to refer to and call a constructor operation, I'd love to know. 🙂
--
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/1862#discussion_r3266368179
You are receiving this because you are subscribed to this thread.
Message ID: <whatwg/fetch/pull/1862/review/4319017720@github.com>
Received on Tuesday, 19 May 2026 12:47:40 UTC