(options = { __proto__: null })
| 87 | #abortHandler; |
| 88 | |
| 89 | constructor(options = { __proto__: null }) { |
| 90 | const { |
| 91 | highWaterMark = kPushDefaultHWM, |
| 92 | backpressure = 'strict', |
| 93 | signal, |
| 94 | } = options; |
| 95 | validateInteger(highWaterMark, 'options.highWaterMark'); |
| 96 | validateBackpressure(backpressure); |
| 97 | if (signal !== undefined) { |
| 98 | validateAbortSignal(signal, 'options.signal'); |
| 99 | } |
| 100 | this.#highWaterMark = clampHWM(highWaterMark); |
| 101 | this.#backpressure = backpressure; |
| 102 | this.#signal = signal; |
| 103 | this.#abortHandler = undefined; |
| 104 | |
| 105 | if (this.#signal) { |
| 106 | this.#abortHandler = () => { |
| 107 | this.fail(isError(this.#signal.reason) ? |
| 108 | this.#signal.reason : |
| 109 | lazyDOMException('Aborted', 'AbortError')); |
| 110 | }; |
| 111 | onSignalAbort(this.#signal, this.#abortHandler); |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | // =========================================================================== |
| 116 | // Writer Methods |
nothing calls this directly
no test coverage detected