diff --git a/lib/internal/webstreams/queuingstrategies.js b/lib/internal/webstreams/queuingstrategies.js index b6a547bd2b22a6..d8750665bd5e86 100644 --- a/lib/internal/webstreams/queuingstrategies.js +++ b/lib/internal/webstreams/queuingstrategies.js @@ -95,7 +95,7 @@ class ByteLengthQueuingStrategy { } [kInspect](depth, options) { - return customInspect(depth, options, 'ByteLengthQueuingStrategy', { + return customInspect(depth, options, this[kType], { highWaterMark: this.highWaterMark, }); } @@ -151,7 +151,7 @@ class CountQueuingStrategy { } [kInspect](depth, options) { - return customInspect(depth, options, 'CountQueuingStrategy', { + return customInspect(depth, options, this[kType], { highWaterMark: this.highWaterMark, }); } diff --git a/lib/internal/webstreams/readablestream.js b/lib/internal/webstreams/readablestream.js index 2d77482a2ea77b..f93ec373283c48 100644 --- a/lib/internal/webstreams/readablestream.js +++ b/lib/internal/webstreams/readablestream.js @@ -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, }); @@ -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, }); @@ -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, @@ -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, @@ -977,10 +977,7 @@ class ReadableStreamDefaultController { } [kInspect](depth, options) { - return customInspect( - depth, - options, - 'ReadableStreamDefaultController', { }); + return customInspect(depth, options, this[kType], { }); } } @@ -1109,10 +1106,7 @@ class ReadableByteStreamController { } [kInspect](depth, options) { - return customInspect( - depth, - options, - 'ReadableByteStreamController', { }); + return customInspect(depth, options, this[kType], { }); } } diff --git a/lib/internal/webstreams/transformstream.js b/lib/internal/webstreams/transformstream.js index fd77d52fbff943..745675266f7f1b 100644 --- a/lib/internal/webstreams/transformstream.js +++ b/lib/internal/webstreams/transformstream.js @@ -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, @@ -303,7 +303,7 @@ class TransformStreamDefaultController { } [kInspect](depth, options) { - return customInspect(depth, options, 'TransformStreamDefaultController', { + return customInspect(depth, options, this[kType], { stream: this[kState].stream, }); } diff --git a/lib/internal/webstreams/writablestream.js b/lib/internal/webstreams/writablestream.js index 798c9ed4c434dd..8e6519820aaf17 100644 --- a/lib/internal/webstreams/writablestream.js +++ b/lib/internal/webstreams/writablestream.js @@ -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, }); @@ -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, @@ -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'); @@ -521,7 +527,7 @@ class WritableStreamDefaultController { } [kInspect](depth, options) { - return customInspect(depth, options, 'WritableStreamDefaultController', { + return customInspect(depth, options, this[kType], { stream: this[kState].stream, }); }