* Closes the stream. The underlying sink will finish processing any previously-written chunks, before invoking its * close behavior. During this time any further attempts to write will fail (without erroring the stream). * * The method returns a promise that will fulfill i
()
| 12171 | * a `TypeError` (without attempting to cancel the stream) if the stream is currently locked. |
| 12172 | */ |
| 12173 | close() { |
| 12174 | if (!IsWritableStream(this)) { |
| 12175 | return promiseRejectedWith(streamBrandCheckException$2("close")); |
| 12176 | } |
| 12177 | if (IsWritableStreamLocked(this)) { |
| 12178 | return promiseRejectedWith(new TypeError("Cannot close a stream that already has a writer")); |
| 12179 | } |
| 12180 | if (WritableStreamCloseQueuedOrInFlight(this)) { |
| 12181 | return promiseRejectedWith(new TypeError("Cannot close an already-closing stream")); |
| 12182 | } |
| 12183 | return WritableStreamClose(this); |
| 12184 | } |
| 12185 | /** |
| 12186 | * Creates a {@link WritableStreamDefaultWriter | writer} and locks the stream to the new writer. While the stream |
| 12187 | * is locked, no other writer can be acquired until this one is released. |
nothing calls this directly
no test coverage detected