* Records each wait on `source.next()` as an `AwaitAnalysis` slice. Nothing else runs on the * main thread meanwhile, as `sliceAsync` requires.
(tracer: Tracer, source: AsyncIterable<T>)
| 95 | * main thread meanwhile, as `sliceAsync` requires. |
| 96 | */ |
| 97 | async function* timeEachNext<T>(tracer: Tracer, source: AsyncIterable<T>): AsyncGenerator<T> { |
| 98 | const iterator = source[Symbol.asyncIterator](); |
| 99 | let done = false; |
| 100 | try { |
| 101 | while (true) { |
| 102 | const next = await tracer.sliceAsync(SpanKind.AwaitAnalysis, () => iterator.next()); |
| 103 | if (next.done) { |
| 104 | done = true; |
| 105 | return; |
| 106 | } |
| 107 | yield next.value; |
| 108 | } |
| 109 | } finally { |
| 110 | if (!done) { |
| 111 | await iterator.return?.(); |
| 112 | } |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | async function writeDiagnosticsFile( |
| 117 | compiler: HybridCompiler, |
no test coverage detected