diff --git a/index.bs b/index.bs index 3b9129201..e96c7fb77 100644 --- a/index.bs +++ b/index.bs @@ -2101,7 +2101,7 @@ The following abstract operations operate on {{ReadableStream}} instances at a h 1. Let |promise| be [=a new promise=]. 1. If |signal| is not undefined, 1. Let |abortAlgorithm| be the following steps: - 1. Let |error| be a new "{{AbortError}}" {{DOMException}}. + 1. Let |error| be |signal|'s [=AbortSignal/abort reason=]. 1. Let |actions| be an empty [=ordered set=]. 1. If |preventAbort| is false, [=set/append=] the following action to |actions|: 1. If |dest|.[=WritableStream/[[state]]=] is "`writable`", return ! @@ -2113,8 +2113,7 @@ The following abstract operations operate on {{ReadableStream}} instances at a h 1. Otherwise, return [=a promise resolved with=] undefined. 1. [=Shutdown with an action=] consisting of [=getting a promise to wait for all=] of the actions in |actions|, and with |error|. - 1. If |signal|'s [=AbortSignal/aborted flag=] is set, perform |abortAlgorithm| and return - |promise|. + 1. If |signal| is [=AbortSignal/aborted=], perform |abortAlgorithm| and return |promise|. 1. [=AbortSignal/Add=] |abortAlgorithm| to |signal|. 1. [=In parallel=] but not really; see #905, using |reader| and @@ -4518,7 +4517,8 @@ The following abstract operations operate on {{WritableStream}} instances at a h 1. If |stream|.[=WritableStream/[[state]]=] is "`closed`" or "`errored`", return [=a promise resolved with=] undefined. 1. [=Signal abort=] on - |stream|.[=WritableStream/[[controller]]=].[=WritableStreamDefaultController/[[signal]]=]. + |stream|.[=WritableStream/[[controller]]=].[=WritableStreamDefaultController/[[signal]]=] with + |reason|. 1. Let |state| be |stream|.[=WritableStream/[[state]]=]. 1. If |state| is "`closed`" or "`errored`", return [=a promise resolved with=] undefined.
We re-check the state because [=signaling abort=] runs author code and that might diff --git a/reference-implementation/lib/abstract-ops/readable-streams.js b/reference-implementation/lib/abstract-ops/readable-streams.js index 03251e6ee..4186d85d4 100644 --- a/reference-implementation/lib/abstract-ops/readable-streams.js +++ b/reference-implementation/lib/abstract-ops/readable-streams.js @@ -146,7 +146,7 @@ function ReadableStreamPipeTo(source, dest, preventClose, preventAbort, preventC let abortAlgorithm; if (signal !== undefined) { abortAlgorithm = () => { - const error = new DOMException('Aborted', 'AbortError'); + const error = signal.reason; const actions = []; if (preventAbort === false) { actions.push(() => { diff --git a/reference-implementation/lib/abstract-ops/writable-streams.js b/reference-implementation/lib/abstract-ops/writable-streams.js index d090165b4..cf303bfe7 100644 --- a/reference-implementation/lib/abstract-ops/writable-streams.js +++ b/reference-implementation/lib/abstract-ops/writable-streams.js @@ -107,7 +107,7 @@ function WritableStreamAbort(stream, reason) { if (stream._state === 'closed' || stream._state === 'errored') { return promiseResolvedWith(undefined); } - stream._controller._abortController.abort(); + stream._controller._abortController.abort(reason); const state = stream._state; if (state === 'closed' || state === 'errored') { return promiseResolvedWith(undefined); diff --git a/reference-implementation/package.json b/reference-implementation/package.json index e2ff0f6fd..e89c27657 100644 --- a/reference-implementation/package.json +++ b/reference-implementation/package.json @@ -19,6 +19,6 @@ "minimatch": "^3.0.4", "opener": "^1.5.1", "webidl2js": "^16.2.0", - "wpt-runner": "^3.2.1" + "wpt-runner": "^4.0.0" } } diff --git a/reference-implementation/web-platform-tests b/reference-implementation/web-platform-tests index 96ca25f0f..4905296d5 160000 --- a/reference-implementation/web-platform-tests +++ b/reference-implementation/web-platform-tests @@ -1 +1 @@ -Subproject commit 96ca25f0f7526282c0d47e6bf6a7edd439da1968 +Subproject commit 4905296d5e2381e2feaadeb7b92a77abe9ebf0f6