get-iterator-method.js 417 B

123456789101112
  1. var classof = require('../internals/classof');
  2. var getMethod = require('../internals/get-method');
  3. var Iterators = require('../internals/iterators');
  4. var wellKnownSymbol = require('../internals/well-known-symbol');
  5. var ITERATOR = wellKnownSymbol('iterator');
  6. module.exports = function (it) {
  7. if (it != undefined) return getMethod(it, ITERATOR)
  8. || getMethod(it, '@@iterator')
  9. || Iterators[classof(it)];
  10. };