Skip to content

Commit

Permalink
Actually define Blob-to-ReadableStream conversion
Browse files Browse the repository at this point in the history
Together with #1505 this fixes #1504.
  • Loading branch information
annevk authored Oct 21, 2022
1 parent 813788a commit 4cd70cf
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -6544,10 +6544,19 @@ typedef (ReadableStream or XMLHttpRequestBodyInit) BodyInit;</pre>
steps:

<ol>
<li><p>Let <var>stream</var> be <var>object</var> if <var>object</var> is a {{ReadableStream}}
object. Otherwise, let <var>stream</var> be a <a>new</a> {{ReadableStream}}, and
<li><p>Let <var>stream</var> be null.

<li><p>If <var>object</var> is a {{ReadableStream}} object, then set <var>stream</var> to
<var>object</var>.

<li><p>Otherwise, if <var>object</var> is a {{Blob}} object, set <var>stream</var> to the result of
running <var>object</var>'s <a for=Blob>get stream</a>.

<li><p>Otherwise, set <var>stream</var> to a <a>new</a> {{ReadableStream}} object, and
<a for=ReadableStream>set up</a> <var>stream</var>.

<li><p><a for=/>Assert</a>: <var>stream</var> is a {{ReadableStream}} object.

<li><p>Let <var>action</var> be null.

<li><p>Let <var>source</var> be null.
Expand All @@ -6562,8 +6571,6 @@ steps:
<dl class=switch>
<dt>{{Blob}}
<dd>
<p>Set <var>action</var> to this step: read <var>object</var>.

<p>Set <var>source</var> to <var>object</var>.

<p>Set <var>length</var> to <var>object</var>'s {{Blob/size}}.
Expand Down

0 comments on commit 4cd70cf

Please sign in to comment.