src/third_party/mozjs/extract/js/src/builtin/Iterator.js
/* Iterator Helpers proposal 2.1.5.2 Body */
Iterator Helpers proposal 2.1.5.2 Body
Iterator Helpers proposal 2 . 1 . 5 . 2 Body
function* IteratorMapGenerator(iterated, mapper) {
  let lastValue;
  let needClose = true;
  try {
    yield;
    needClose = false;
    for (let next = IteratorStep(iterated, lastValue);
        next;
        next = IteratorStep(iterated, lastValue)) {
      const value = next.value;
      needClose = true;
      lastValue = yield callContentFunction(mapper, undefined, value);
      needClose = false;
    }
  } finally {
    if (needClose) {
      IteratorClose(iterated);
    }
  }
}
function * IteratorMapGenerator ( iterated , mapper ) { let lastValue ; let needClose = true ; try { yield ; needClose = false ; for ( let next = IteratorStep ( iterated , lastValue ) ; next ; next = IteratorStep ( iterated , lastValue ) ) { const value = next . value ; needClose = true ; lastValue = yield callContentFunction ( mapper , undefined , value ) ; needClose = false ; } } finally { if ( needClose ) { IteratorClose ( iterated ) ; } } }
Iterator Helpers proposal 2.1.5.2 Body
Iterator Helpers proposal 2 . 1 . 5 . 2 Body
// Step 1. // Step 2. // Step c. // Steps d-g.