Skip to content

Commit

Permalink
[Squash] Minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed Jun 25, 2021
1 parent bd86655 commit 511cfad
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions lib/internal/webstreams/queuingstrategies.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class ByteLengthQueuingStrategy {
}

[kInspect](depth, options) {
return customInspect(depth, options, 'ByteLengthQueuingStrategy', {
return customInspect(depth, options, this[kType], {
highWaterMark: this.highWaterMark,
});
}
Expand Down Expand Up @@ -151,7 +151,7 @@ class CountQueuingStrategy {
}

[kInspect](depth, options) {
return customInspect(depth, options, 'CountQueuingStrategy', {
return customInspect(depth, options, this[kType], {
highWaterMark: this.highWaterMark,
});
}
Expand Down
18 changes: 6 additions & 12 deletions lib/internal/webstreams/readablestream.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ class ReadableStream {
}

[kInspect](depth, options) {
return customInspect(depth, options, 'ReadableStream', {
return customInspect(depth, options, this[kType], {
locked: this.locked,
state: this[kState].state,
});
Expand Down Expand Up @@ -651,7 +651,7 @@ class ReadableStreamBYOBRequest {
}

[kInspect](depth, options) {
return customInspect(depth, options, 'ReadableStreamBYOBRequest', {
return customInspect(depth, options, this[kType], {
view: this.view,
controller: this[kState].controller,
});
Expand Down Expand Up @@ -797,7 +797,7 @@ class ReadableStreamDefaultReader {
}

[kInspect](depth, options) {
return customInspect(depth, options, 'ReadableStreamDefaultReader', {
return customInspect(depth, options, this[kType], {
stream: this[kState].stream,
readRequests: this[kState].readRequests.length,
close: this[kState].close.promise,
Expand Down Expand Up @@ -914,7 +914,7 @@ class ReadableStreamBYOBReader {
}

[kInspect](depth, options) {
return customInspect(depth, options, 'ReadableStreamBYOBReader', {
return customInspect(depth, options, this[kType], {
stream: this[kState].stream,
requestIntoRequests: this[kState].requestIntoRequests.length,
close: this[kState].close.promise,
Expand Down Expand Up @@ -977,10 +977,7 @@ class ReadableStreamDefaultController {
}

[kInspect](depth, options) {
return customInspect(
depth,
options,
'ReadableStreamDefaultController', { });
return customInspect(depth, options, this[kType], { });
}
}

Expand Down Expand Up @@ -1109,10 +1106,7 @@ class ReadableByteStreamController {
}

[kInspect](depth, options) {
return customInspect(
depth,
options,
'ReadableByteStreamController', { });
return customInspect(depth, options, this[kType], { });
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/internal/webstreams/transformstream.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class TransformStream {
}

[kInspect](depth, options) {
return customInspect(depth, options, 'TransformStream', {
return customInspect(depth, options, this[kType], {
readable: this.readable,
writable: this.writable,
backpressure: this[kState].backpressure,
Expand Down Expand Up @@ -303,7 +303,7 @@ class TransformStreamDefaultController {
}

[kInspect](depth, options) {
return customInspect(depth, options, 'TransformStreamDefaultController', {
return customInspect(depth, options, this[kType], {
stream: this[kState].stream,
});
}
Expand Down
12 changes: 9 additions & 3 deletions lib/internal/webstreams/writablestream.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class WritableStream {
}

[kInspect](depth, options) {
return customInspect(depth, options, 'WritableStream', {
return customInspect(depth, options, this[kType], {
locked: this.locked,
state: this[kState].state,
});
Expand Down Expand Up @@ -459,7 +459,7 @@ class WritableStreamDefaultWriter {
}

[kInspect](depth, options) {
return customInspect(depth, options, 'WritableStreamDefaultWriter', {
return customInspect(depth, options, this[kType], {
stream: this[kState].stream,
close: this[kState].close.promise,
ready: this[kState].ready.promise,
Expand Down Expand Up @@ -497,12 +497,18 @@ class WritableStreamDefaultController {
resetQueue(this);
}

/**
* @type {any}
*/
get abortReason() {
if (!isWritableStreamDefaultController(this))
throw new ERR_INVALID_THIS('WritableStreamDefaultController');
return this[kState].abortReason;
}

/**
* @type {AbortSignal}
*/
get signal() {
if (!isWritableStreamDefaultController(this))
throw new ERR_INVALID_THIS('WritableStreamDefaultController');
Expand All @@ -521,7 +527,7 @@ class WritableStreamDefaultController {
}

[kInspect](depth, options) {
return customInspect(depth, options, 'WritableStreamDefaultController', {
return customInspect(depth, options, this[kType], {
stream: this[kState].stream,
});
}
Expand Down

0 comments on commit 511cfad

Please sign in to comment.