src/third_party/mozjs/extract/js/src/builtin/Iterator.js
/* Iterator Helpers proposal 2.1.5.6 Body */
Iterator Helpers proposal 2.1.5.6 Body
Iterator Helpers proposal 2 . 1 . 5 . 6 Body
function* IteratorAsIndexedPairsGenerator(iterated) {
  let lastValue;
  let needClose = true;
  try {
    yield;
    needClose = false;
    for (let next = IteratorStep(iterated, lastValue), index = 0;
        next;
        next = IteratorStep(iterated, lastValue), index++) {
      const value = next.value;
      needClose = true;
      lastValue = yield [index, value];
      needClose = false;
    }
  } finally {
    if (needClose) {
      IteratorClose(iterated);
    }
  }
}
function * IteratorAsIndexedPairsGenerator ( iterated ) { let lastValue ; let needClose = true ; try { yield ; needClose = false ; for ( let next = IteratorStep ( iterated , lastValue ) , index = 0 ; next ; next = IteratorStep ( iterated , lastValue ) , index ++ ) { const value = next . value ; needClose = true ; lastValue = yield [ index , value ] ; needClose = false ; } } finally { if ( needClose ) { IteratorClose ( iterated ) ; } } }
Iterator Helpers proposal 2.1.5.6 Body
Iterator Helpers proposal 2 . 1 . 5 . 6 Body
// Step 2. // Step 3. // Steps c-d.