MCPcopy Index your code
hub / github.com/nodejs/node / [SymbolAsyncIterator]

Function [SymbolAsyncIterator]

lib/internal/streams/iter/pull.js:736–764  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

734 return {
735 __proto__: null,
736 async *[SymbolAsyncIterator]() {
737 const iterator = source[SymbolAsyncIterator]();
738 let completed = false;
739 let aborted = false;
740
741 try {
742 while (true) {
743 const { done, value } = await abortableNext(iterator, signal);
744 if (done) {
745 completed = true;
746 return;
747 }
748 signal.throwIfAborted();
749 yield value;
750 }
751 } catch (error) {
752 aborted = signal.aborted;
753 throw error;
754 } finally {
755 if (!completed && typeof iterator.return === 'function') {
756 const result = iterator.return();
757 if (aborted) {
758 markPromiseAsHandled(result);
759 } else {
760 await result;
761 }
762 }
763 }
764 },
765 };
766}
767

Callers

nothing calls this directly

Calls 5

abortableNextFunction · 0.85
createAsyncPipelineFunction · 0.85
throwIfAbortedMethod · 0.80
fromFunction · 0.70
returnMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…