You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: writable-stream-abort-signal-explainer.md
+4-3
Original file line number
Diff line number
Diff line change
@@ -21,8 +21,6 @@ streams such as [WebTransport](https://w3c.github.io/webtransport/).
21
21
On [WritableStreamDefaultController](https://streams.spec.whatwg.org/#writablestreamdefaultcontroller)
22
22
(the controller argument that is passed to underlying sinks):
23
23
24
-
*[`abortReason`](https://streams.spec.whatwg.org/#writablestreamdefaultcontroller-abortreason): The argument passed
25
-
to `writable.abort()` or `writer.abort()`. Undefined if no argument was passed or `abort()` hasn't been called.
26
24
*[`signal`](https://streams.spec.whatwg.org/#writablestreamdefaultcontroller-signal): An AbortSignal. By using
27
25
`signal.addEventListener('abort', …)` an underlying sink can abort the pending write or close operation when the
28
26
stream is aborted.
@@ -44,7 +42,7 @@ const ws = new WritableStream({
44
42
returnnewPromise((resolve, reject) => {
45
43
setTimeout(resolve, 1000);
46
44
controller.signal.addEventListener('abort',
47
-
() =>reject(controller.abortReason));
45
+
() =>reject(controller.signal.reason));
48
46
});
49
47
}
50
48
});
@@ -117,3 +115,6 @@ would be unclear and confusing.
117
115
* It was initially proposed that an `AbortSignal` could be passed to each sink `write()` call. However, since the
118
116
abort signal does not need to change between two `write()` calls, it was thought better to just add a `signal` property
119
117
on `WritableStreamDefaultController`.
118
+
* Previously, [WritableStreamDefaultController](https://streams.spec.whatwg.org/#writablestreamdefaultcontroller) had
119
+
an `abortReason` property that was an argument given to
120
+
[WritableStreamAbort](https://streams.spec.whatwg.org/#writable-stream-abort). However, after some discussion, it was thought better to just add the `reason` property to the `AbortSignal`.
0 commit comments