* If the reader is active, behaves the same as WritableStream.close | stream.close().
()
| 12523 | * If the reader is active, behaves the same as {@link WritableStream.close | stream.close()}. |
| 12524 | */ |
| 12525 | close() { |
| 12526 | if (!IsWritableStreamDefaultWriter(this)) { |
| 12527 | return promiseRejectedWith(defaultWriterBrandCheckException("close")); |
| 12528 | } |
| 12529 | const stream4 = this._ownerWritableStream; |
| 12530 | if (stream4 === void 0) { |
| 12531 | return promiseRejectedWith(defaultWriterLockException("close")); |
| 12532 | } |
| 12533 | if (WritableStreamCloseQueuedOrInFlight(stream4)) { |
| 12534 | return promiseRejectedWith(new TypeError("Cannot close an already-closing stream")); |
| 12535 | } |
| 12536 | return WritableStreamDefaultWriterClose(this); |
| 12537 | } |
| 12538 | /** |
| 12539 | * Releases the writer’s lock on the corresponding stream. After the lock is released, the writer is no longer active. |
| 12540 | * If the associated stream is errored when the lock is released, the writer will appear errored in the same way from |
nothing calls this directly
no test coverage detected