Skip to content

Commit 75a80a8

Browse files
MattiasBuelensdomenic
authored andcommitted
Add note about a tee'd readable byte stream always cloning each chunk
1 parent 6ce0ff0 commit 75a80a8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

index.bs

+6-2
Original file line numberDiff line numberDiff line change
@@ -764,8 +764,9 @@ option. If {{UnderlyingSource/type}} is set to undefined (including via omission
764764
resulting branches; a composite cancellation reason will then be propagated to the stream's
765765
[=underlying source=].
766766

767-
<p>Note that the [=chunks=] seen in each branch will be the same object. If the chunks are not
768-
immutable, this could allow interference between the two branches.
767+
<p>If this stream is a [=readable byte stream=], then each branch will receive its own copy of
768+
each [=chunk=]. If not, then the chunks seen in each branch will be the same object.
769+
If the chunks are not immutable, this could allow interference between the two branches.
769770
</dl>
770771

771772
<div algorithm>
@@ -2215,6 +2216,9 @@ create them does not matter.
22152216
objects|transferring=] their [=chunks=]. However, it does introduce a noticeable asymmetry between
22162217
the two branches, and limits the possible [=chunks=] to serializable ones. [[!HTML]]
22172218

2219+
If |stream| is a [=readable byte stream=], then |cloneForBranch2| is ignored and chunks are cloned
2220+
unconditionally.
2221+
22182222
<p class="note">In this standard ReadableStreamTee is always called with |cloneForBranch2| set to
22192223
false; other specifications pass true via the [=ReadableStream/tee=] wrapper algorithm.
22202224

0 commit comments

Comments
 (0)