source: imaps-frontend/node_modules/es-abstract/2023/IteratorStep.js@ d565449

main
Last change on this file since d565449 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
RevLine 
[d565449]1'use strict';
2
3var $TypeError = require('es-errors/type');
4
5var IteratorComplete = require('./IteratorComplete');
6var IteratorNext = require('./IteratorNext');
7
8var isIteratorRecord = require('../helpers/records/iterator-record');
9
10// https://262.ecma-international.org/14.0/#sec-iteratorstep
11
12module.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.