aboutsummaryrefslogtreecommitdiff
path: root/node_modules/core-js/internals/get-iterator.js
blob: f7f7f8ef3b60c4513c28d5fec36dd89aad57a66f (plain)
1
2
3
4
5
6
7
8
9
var anObject = require('../internals/an-object');
var getIteratorMethod = require('../internals/get-iterator-method');

module.exports = function (it) {
  var iteratorMethod = getIteratorMethod(it);
  if (typeof iteratorMethod != 'function') {
    throw TypeError(String(it) + ' is not iterable');
  } return anObject(iteratorMethod.call(it));
};