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:
655 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | var $TypeError = require('es-errors/type');
|
---|
4 |
|
---|
5 | var IteratorComplete = require('./IteratorComplete');
|
---|
6 | var IteratorNext = require('./IteratorNext');
|
---|
7 |
|
---|
8 | var isIteratorRecord = require('../helpers/records/iterator-record');
|
---|
9 |
|
---|
10 | // https://262.ecma-international.org/14.0/#sec-iteratorstep
|
---|
11 |
|
---|
12 | module.exports = function IteratorStep(iteratorRecord) {
|
---|
13 | if (!isIteratorRecord(iteratorRecord)) {
|
---|
14 | throw new $TypeError('Assertion failed: `iteratorRecord` must be an Iterator Record'); // step 1
|
---|
15 | }
|
---|
16 |
|
---|
17 | var result = IteratorNext(iteratorRecord); // step 1
|
---|
18 | var done = IteratorComplete(result); // step 2
|
---|
19 | return done === true ? false : result; // steps 3-4
|
---|
20 | };
|
---|
21 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.