@@ -6941,13 +6941,28 @@ for="ReadableStream">locked</dfn> if ! [$IsReadableStreamLocked$](|stream|) retu
6941
6941
directly on the [=this=] value inside their constructor steps.</p>
6942
6942
</div>
6943
6943
6944
- The following algorithm must only be used on {{WritableStream}} instances initialized via the above
6945
- [=WritableStream/set up=] algorithm:
6944
+ The following definitions must only be used on {{WritableStream}} instances initialized via the
6945
+ above [=WritableStream/set up=] algorithm:
6946
6946
6947
6947
<p algorithm> To <dfn export for="WritableStream" lt="error|erroring">error</dfn> a
6948
6948
{{WritableStream}} |stream| given a JavaScript value |e|, perform !
6949
6949
[$WritableStreamDefaultControllerErrorIfNeeded$] (|stream|.[=WritableStream/[[controller]]=] , |e|).
6950
6950
6951
+ <p> The <dfn export for="WritableStream">signal</dfn> of a {{WritableStream}} |stream| is
6952
+ |stream|.[=WritableStream/[[controller]]=] .[=WritableStreamDefaultController/[[signal]]=] .
6953
+ Specifications can [=AbortSignal/add=] or [=AbortSignal/remove=] algorithms to this
6954
+ {{AbortSignal}} , or consult whether it is [=AbortSignal/aborted=] and its [=AbortSignal/abort
6955
+ reason=] . Specifications should not [=AbortSignal/signal abort=] or make it [=AbortSignal/follow=]
6956
+ another {{AbortSignal}} , as that would interfere with the normal use of this signal to respond to
6957
+ the stream being [=abort a writable stream|aborted=] .
6958
+
6959
+ <p class="note"> The usual usage is, after [=WritableStream/setting up=] the {{WritableStream}} ,
6960
+ [=AbortSignal/add=] an algorithm to its [=WritableStream/signal=] , which aborts any ongoing write
6961
+ operation to the [=underlying sink=] . Then, inside the <var ignore> [=WritableStream/set
6962
+ up/writeAlgorithm=] </var> , once the [=underlying sink=] has responded, check if the
6963
+ [=WritableStream/signal=] is [=AbortSignal/aborted=] , and [=reject=] the returned promise with the
6964
+ signal's [=AbortSignal/abort reason=] if so.
6965
+
6951
6966
<h4 id="other-specs-ws-writing">Writing</h4>
6952
6967
6953
6968
The following algorithms can be used on arbitrary {{WritableStream}} instances, including ones that
0 commit comments