source: imaps-frontend/node_modules/es-abstract/2024/IteratorStep.js@ 0c6b92a

main
Last change on this file since 0c6b92a was 0c6b92a, checked in by stefan toskovski <stefantoska84@…>, 5 weeks ago

Pred finalna verzija

  • 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
[0c6b92a]10// https://262.ecma-international.org/15.0/#sec-iteratorstep
[d565449]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.