main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
450 bytes
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | var $TypeError = require('es-errors/type');
|
---|
| 4 |
|
---|
| 5 | var Invoke = require('./Invoke');
|
---|
[79a0317] | 6 |
|
---|
| 7 | var isObject = require('../helpers/isObject');
|
---|
[d565449] | 8 |
|
---|
| 9 | // https://262.ecma-international.org/6.0/#sec-iteratornext
|
---|
| 10 |
|
---|
| 11 | module.exports = function IteratorNext(iterator, value) {
|
---|
| 12 | var result = Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]);
|
---|
[79a0317] | 13 | if (!isObject(result)) {
|
---|
[d565449] | 14 | throw new $TypeError('iterator next must return an object');
|
---|
| 15 | }
|
---|
| 16 | return result;
|
---|
| 17 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.