main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 2 weeks ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
620 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | var call = require('../internals/function-call');
|
---|
3 | var aCallable = require('../internals/a-callable');
|
---|
4 | var anObject = require('../internals/an-object');
|
---|
5 | var tryToString = require('../internals/try-to-string');
|
---|
6 | var getIteratorMethod = require('../internals/get-iterator-method');
|
---|
7 |
|
---|
8 | var $TypeError = TypeError;
|
---|
9 |
|
---|
10 | module.exports = function (argument, usingIterator) {
|
---|
11 | var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
|
---|
12 | if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
|
---|
13 | throw new $TypeError(tryToString(argument) + ' is not iterable');
|
---|
14 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.