source: imaps-frontend/node_modules/es-iterator-helpers/aos/IfAbruptCloseIterators.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: 602 bytes
Line 
1'use strict';
2
3var $TypeError = require('es-errors/type');
4
5var CompletionRecord = require('es-abstract/2024/CompletionRecord');
6var IteratorCloseAll = require('./IteratorCloseAll');
7
8// https://tc39.es/proposal-joint-iteration/#sec-ifabruptcloseiterators
9
10module.exports = function IfAbruptCloseIterators(value, iteratorRecords) {
11 if (!(value instanceof CompletionRecord)) {
12 throw new $TypeError('Assertion failed: `value` must be a Completion Record'); // step 1
13 }
14 if (value.type() === 'throw') {
15 return IteratorCloseAll(iteratorRecords, value); // step 2
16 }
17
18 return value['!'](); // step
19};
Note: See TracBrowser for help on using the repository browser.