Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 [email protected]
  • Loading branch information
daeyeon committed Aug 21, 2022
commit b9e7f6fa97885a0170e06607811ba12f6f6eece7
5 changes: 4 additions & 1 deletion lib/internal/webstreams/writablestream.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions test/wpt/status/streams.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,5 @@
},
"transferable/transfer-with-messageport.window.js": {
"skip": "Browser-specific test"
},
"writable-streams/aborting.any.js": {
"fail": {
"expected": ["WritableStreamDefaultController.signal"]
}
}
}