(chunk)
| 11256 | ReadableByteStreamControllerClose(this); |
| 11257 | } |
| 11258 | enqueue(chunk) { |
| 11259 | if (!IsReadableByteStreamController(this)) { |
| 11260 | throw byteStreamControllerBrandCheckException("enqueue"); |
| 11261 | } |
| 11262 | assertRequiredArgument(chunk, 1, "enqueue"); |
| 11263 | if (!ArrayBuffer.isView(chunk)) { |
| 11264 | throw new TypeError("chunk must be an array buffer view"); |
| 11265 | } |
| 11266 | if (chunk.byteLength === 0) { |
| 11267 | throw new TypeError("chunk must have non-zero byteLength"); |
| 11268 | } |
| 11269 | if (chunk.buffer.byteLength === 0) { |
| 11270 | throw new TypeError(`chunk's buffer must have non-zero byteLength`); |
| 11271 | } |
| 11272 | if (this._closeRequested) { |
| 11273 | throw new TypeError("stream is closed or draining"); |
| 11274 | } |
| 11275 | const state2 = this._controlledReadableByteStream._state; |
| 11276 | if (state2 !== "readable") { |
| 11277 | throw new TypeError(`The stream (in ${state2} state) is not in the readable state and cannot be enqueued to`); |
| 11278 | } |
| 11279 | ReadableByteStreamControllerEnqueue(this, chunk); |
| 11280 | } |
| 11281 | /** |
| 11282 | * Errors the controlled readable stream, making all future interactions with it fail with the given error `e`. |
| 11283 | */ |
nothing calls this directly
no test coverage detected