src/third_party/mozjs/extract/js/src/builtin/AsyncIteration.js
/* Iterator Helpers proposal 2.1.6.5 Body */
Iterator Helpers proposal 2.1.6.5 Body
Iterator Helpers proposal 2 . 1 . 6 . 5 Body
async function* AsyncIteratorDropGenerator(iterated, remaining) {
  let needClose = true;
  try {
    yield;
    needClose = false;
    for (; remaining > 0; remaining--) {
      const next = await IteratorNext(iterated);
      if (next.done) {
        return;
      }
    }
    let lastValue;
    for (let next = await IteratorNext(iterated, lastValue);
        !next.done;
        next = await IteratorNext(iterated, lastValue)) {
      const value = next.value;
      needClose = true;
      lastValue = yield value;
      needClose = false;
    }
  } finally {
    if (needClose) {
      AsyncIteratorClose(iterated);
    }
  }
}
async function * AsyncIteratorDropGenerator ( iterated , remaining ) { let needClose = true ; try { yield ; needClose = false ; for ( ; remaining > 0 ; remaining -- ) { const next = await IteratorNext ( iterated ) ; if ( next . done ) { return ; } } let lastValue ; for ( let next = await IteratorNext ( iterated , lastValue ) ; ! next . done ; next = await IteratorNext ( iterated , lastValue ) ) { const value = next . value ; needClose = true ; lastValue = yield value ; needClose = false ; } } finally { if ( needClose ) { AsyncIteratorClose ( iterated ) ; } } }
Iterator Helpers proposal 2.1.6.5 Body
Iterator Helpers proposal 2 . 1 . 6 . 5 Body
// Step 1. // Step 2. // Step 3. // Steps c-d.