(reason)
| 566 | } |
| 567 | |
| 568 | cancel(reason) { |
| 569 | if (this.#cancelled) return; |
| 570 | this.#cancelled = true; |
| 571 | |
| 572 | if (reason !== undefined) { |
| 573 | this.#sourceError = reason; |
| 574 | } |
| 575 | |
| 576 | if (this.#sourceIterator?.return) { |
| 577 | this.#sourceIterator.return(); |
| 578 | } |
| 579 | |
| 580 | for (const consumer of this.#consumers) { |
| 581 | consumer.detached = true; |
| 582 | } |
| 583 | this.#consumers.clear(); |
| 584 | } |
| 585 | |
| 586 | [SymbolDispose]() { |
| 587 | this.cancel(); |
no test coverage detected