diff options
author | Andreu Botella <abb@randomunok.com> | 2021-12-08 23:31:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-08 23:31:22 +0100 |
commit | 318f48f9adc486e95dcc5f86fd0a1848c6df51f6 (patch) | |
tree | 301483c743901c3cd70330594507c2799a208631 /ext/web/06_streams.js | |
parent | b51b0c834b596383084d4a9991695759af9d27ad (diff) |
feat(streams): support abort reasons in streams (#12991)
Diffstat (limited to 'ext/web/06_streams.js')
-rw-r--r-- | ext/web/06_streams.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/web/06_streams.js b/ext/web/06_streams.js index 15f51ca7a..ed77dde66 100644 --- a/ext/web/06_streams.js +++ b/ext/web/06_streams.js @@ -55,7 +55,6 @@ WeakMapPrototypeSet, } = globalThis.__bootstrap.primordials; const consoleInternal = window.__bootstrap.console; - const { DOMException } = window.__bootstrap.domException; class AssertionError extends Error { constructor(msg) { @@ -1872,7 +1871,7 @@ let abortAlgorithm; if (signal) { abortAlgorithm = () => { - const error = new DOMException("Aborted", "AbortError"); + const error = signal.reason; /** @type {Array<() => Promise<void>>} */ const actions = []; if (preventAbort === false) { @@ -3343,7 +3342,7 @@ if (state === "closed" || state === "errored") { return resolvePromiseWith(undefined); } - stream[_controller][_signal][signalAbort](); + stream[_controller][_signal][signalAbort](reason); if (state === "closed" || state === "errored") { return resolvePromiseWith(undefined); } |