|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
660 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-2023');
|
|---|
| 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.