()
| 1549 | } |
| 1550 | |
| 1551 | function abortAlgorithm() { |
| 1552 | let error; |
| 1553 | if (signal.reason instanceof AbortError) { |
| 1554 | // Cannot use the AbortError class here. It must be a DOMException. |
| 1555 | error = new DOMException(signal.reason.message, 'AbortError'); |
| 1556 | } else { |
| 1557 | error = signal.reason; |
| 1558 | } |
| 1559 | |
| 1560 | const actions = []; |
| 1561 | if (!preventAbort) { |
| 1562 | ArrayPrototypePush( |
| 1563 | actions, |
| 1564 | () => { |
| 1565 | if (dest[kState].state === 'writable') |
| 1566 | return writableStreamAbort(dest, error); |
| 1567 | return PromiseResolve(); |
| 1568 | }); |
| 1569 | } |
| 1570 | if (!preventCancel) { |
| 1571 | ArrayPrototypePush( |
| 1572 | actions, |
| 1573 | () => { |
| 1574 | if (source[kState].state === 'readable') |
| 1575 | return readableStreamCancel(source, error); |
| 1576 | return PromiseResolve(); |
| 1577 | }); |
| 1578 | } |
| 1579 | |
| 1580 | shutdownWithAnAction( |
| 1581 | () => SafePromiseAll(actions, (action) => action()), |
| 1582 | true, |
| 1583 | error); |
| 1584 | } |
| 1585 | |
| 1586 | function watchErrored(stream, promise, action) { |
| 1587 | if (stream[kState].state === 'errored') |
no test coverage detected
searching dependent graphs…