source: frontend/node_modules/es-abstract/2025/IfAbruptCloseIterator.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: 576 bytes
Line 
1'use strict';
2
3var $TypeError = require('es-errors/type');
4
5var CompletionRecord = require('./CompletionRecord');
6var IteratorClose = require('./IteratorClose');
7
8// https://262.ecma-international.org/16.0/#sec-ifabruptcloseiterator
9
10module.exports = function IfAbruptCloseIterator(value, iteratorRecord) {
11 if (!(value instanceof CompletionRecord)) {
12 throw new $TypeError('Assertion failed: `value` must be a Completion Record'); // step 1
13 }
14 if (value.type() !== 'normal') {
15 return IteratorClose(iteratorRecord, value); // step 2
16 }
17
18 return value['!'](); // step 3
19};
Note: See TracBrowser for help on using the repository browser.