mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
stream: fix writableStream.abort()
This includes: - Fixing `writableStream.abort(reason)`. Passing the reason was missing. - Leaving a TODO to remove the internal abortReason property of WritableStreamDefaultController. Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com PR-URL: https://github.com/nodejs/node/pull/44327 Refs: https://streams.spec.whatwg.org/#writable-stream-abort Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit is contained in:
1 parent
d8d34ae6bc
commit
667e8bf3fb
2 files changed
+4
-6
No files matched your search
@@ -637,8 +637,11 @@ function writableStreamAbort(stream, reason) {
|
||||
if (state === 'closed' || state === 'errored')
|
||||
return PromiseResolve();
|
||||
|
||||
// TODO(daeyeon): Remove `controller[kState].abortReason` and use
|
||||
// `controller[kState].abortController.signal.reason` for the
|
||||
// `WritableStreamDefaultController.prototype.abortReason` getter.
|
||||
controller[kState].abortReason = reason;
|
||||
controller[kState].abortController.abort();
|
||||
controller[kState].abortController.abort(reason);
|
||||
|
||||
if (stream[kState].pendingAbortRequest.abort.promise !== undefined)
|
||||
return stream[kState].pendingAbortRequest.abort.promise;
|
||||
|
||||
@@ -80,10 +80,5 @@
|
||||
},
|
||||
"transferable/transfer-with-messageport.window.js": {
|
||||
"skip": "Browser-specific test"
|
||||
},
|
||||
"writable-streams/aborting.any.js": {
|
||||
"fail": {
|
||||
"expected": ["WritableStreamDefaultController.signal"]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user