src/third_party/mozjs/extract/js/src/builtin/Iterator.js
/* Iterator Helpers proposal 2.1.5.7 Body */
Iterator Helpers proposal 2.1.5.7 Body
Iterator Helpers proposal 2 . 1 . 5 . 7 Body
function* IteratorFlatMapGenerator(iterated, mapper) {
  let needClose = true;
  try {
    yield;
    needClose = false;
    for (let next = IteratorStep(iterated);
        next;
        next = IteratorStep(iterated)) {
      const value = next.value;
      needClose = true;
      const mapped = callContentFunction(mapper, undefined, value);
      for (const innerValue of allowContentIter(mapped)) {
        yield innerValue;
      }
      needClose = false;
    }
  } finally {
    if (needClose) {
      IteratorClose(iterated);
    }
  }
}
function * IteratorFlatMapGenerator ( iterated , mapper ) { let needClose = true ; try { yield ; needClose = false ; for ( let next = IteratorStep ( iterated ) ; next ; next = IteratorStep ( iterated ) ) { const value = next . value ; needClose = true ; const mapped = callContentFunction ( mapper , undefined , value ) ; for ( const innerValue of allowContentIter ( mapped ) ) { yield innerValue ; } needClose = false ; } } finally { if ( needClose ) { IteratorClose ( iterated ) ; } } }
Iterator Helpers proposal 2.1.5.7 Body
Iterator Helpers proposal 2 . 1 . 5 . 7 Body
// Step 1. // Step c. // Step d. // Steps f-i.