source: frontend/node_modules/es-iterator-helpers/aos/IfAbruptCloseIterators.js

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: 602 bytes
Line 
1'use strict';
2
3var $TypeError = require('es-errors/type');
4
5var CompletionRecord = require('es-abstract/2025/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.