iterator-close.js 230 B

12345678
  1. var anObject = require('../internals/an-object');
  2. module.exports = function (iterator) {
  3. var returnMethod = iterator['return'];
  4. if (returnMethod !== undefined) {
  5. return anObject(returnMethod.call(iterator)).value;
  6. }
  7. };