|
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 |
|
|---|
| 3 | var $TypeError = require('es-errors/type');
|
|---|
| 4 |
|
|---|
| 5 | var CompletionRecord = require('./CompletionRecord');
|
|---|
| 6 | var IteratorClose = require('./IteratorClose');
|
|---|
| 7 |
|
|---|
| 8 | // https://262.ecma-international.org/16.0/#sec-ifabruptcloseiterator
|
|---|
| 9 |
|
|---|
| 10 | module.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.