(
iterator: AsyncIterator<T>,
)
| 77 | } |
| 78 | |
| 79 | async #callIteratorNext( |
| 80 | iterator: AsyncIterator<T>, |
| 81 | ) { |
| 82 | try { |
| 83 | const { value, done } = await iterator.next(); |
| 84 | if (done) { |
| 85 | --this.#iteratorCount; |
| 86 | } else { |
| 87 | this.#yields.push({ iterator, value }); |
| 88 | } |
| 89 | } catch (e) { |
| 90 | this.#throws.push(e); |
| 91 | } |
| 92 | this.#signal.resolve(); |
| 93 | } |
| 94 | |
| 95 | /** |
| 96 | * Returns an async iterator of the stream. |