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 |
|
---|
3 | var $TypeError = require('es-errors/type');
|
---|
4 |
|
---|
5 | var CompletionRecord = require('es-abstract/2024/CompletionRecord');
|
---|
6 | var IteratorCloseAll = require('./IteratorCloseAll');
|
---|
7 |
|
---|
8 | // https://tc39.es/proposal-joint-iteration/#sec-ifabruptcloseiterators
|
---|
9 |
|
---|
10 | module.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.