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