diff options
Diffstat (limited to 'node_modules/core-js/internals/get-iterator.js')
| -rw-r--r-- | node_modules/core-js/internals/get-iterator.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/node_modules/core-js/internals/get-iterator.js b/node_modules/core-js/internals/get-iterator.js new file mode 100644 index 0000000..f7f7f8e --- /dev/null +++ b/node_modules/core-js/internals/get-iterator.js @@ -0,0 +1,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)); +}; |
