Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 00185f1

Browse filesBrowse files
daeyeonRafaelGSS
authored andcommitted
stream: remove abortReason from WritableStreamDefaultController
The `abortReason` has been removed from the spec since we can get the abort reason via `controller.signal.reason`. This reflects the change. Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com PR-URL: #44540 Refs: https://streams.spec.whatwg.org/#ws-default-controller-class-definition Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 4a77a11 commit 00185f1
Copy full SHA for 00185f1

File tree

Expand file treeCollapse file tree

3 files changed

+0
-25
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+0
-25
lines changed
Open diff view settings
Collapse file

‎doc/api/webstreams.md‎

Copy file name to clipboardExpand all lines: doc/api/webstreams.md
-4Lines changed: 0 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -978,10 +978,6 @@ changes:
978978
The `WritableStreamDefaultController` manage's the {WritableStream}'s
979979
internal state.
980980
981-
#### `writableStreamDefaultController.abortReason`
982-
983-
* Type: {any} The `reason` value passed to `writableStream.abort()`.
984-
985981
#### `writableStreamDefaultController.error(error)`
986982
987983
<!-- YAML
Collapse file

‎lib/internal/webstreams/writablestream.js‎

Copy file name to clipboardExpand all lines: lib/internal/webstreams/writablestream.js
-15Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -508,15 +508,6 @@ class WritableStreamDefaultController {
508508
resetQueue(this);
509509
}
510510

511-
/**
512-
* @type {any}
513-
*/
514-
get abortReason() {
515-
if (!isWritableStreamDefaultController(this))
516-
throw new ERR_INVALID_THIS('WritableStreamDefaultController');
517-
return this[kState].abortReason;
518-
}
519-
520511
/**
521512
* @type {AbortSignal}
522513
*/
@@ -545,7 +536,6 @@ class WritableStreamDefaultController {
545536
}
546537

547538
ObjectDefineProperties(WritableStreamDefaultController.prototype, {
548-
abortReason: kEnumerableProperty,
549539
signal: kEnumerableProperty,
550540
error: kEnumerableProperty,
551541
});
@@ -637,10 +627,6 @@ function writableStreamAbort(stream, reason) {
637627
if (state === 'closed' || state === 'errored')
638628
return PromiseResolve();
639629

640-
// TODO(daeyeon): Remove `controller[kState].abortReason` and use
641-
// `controller[kState].abortController.signal.reason` for the
642-
// `WritableStreamDefaultController.prototype.abortReason` getter.
643-
controller[kState].abortReason = reason;
644630
controller[kState].abortController.abort(reason);
645631

646632
if (stream[kState].pendingAbortRequest.abort.promise !== undefined)
@@ -1253,7 +1239,6 @@ function setupWritableStreamDefaultController(
12531239
assert(stream[kState].controller === undefined);
12541240
controller[kState] = {
12551241
abortAlgorithm,
1256-
abortReason: undefined,
12571242
closeAlgorithm,
12581243
highWaterMark,
12591244
queue: [],
Collapse file

‎test/parallel/test-whatwg-writablestream.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-whatwg-writablestream.js
-6Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,6 @@ class Sink {
198198
code: 'ERR_INVALID_THIS',
199199
});
200200

201-
assert.throws(() => {
202-
Reflect.get(WritableStreamDefaultController.prototype, 'abortReason', {});
203-
}, {
204-
code: 'ERR_INVALID_THIS',
205-
});
206-
207201
assert.throws(() => {
208202
Reflect.get(WritableStreamDefaultController.prototype, 'signal', {});
209203
}, {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.