summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2021-06-16 02:46:08 +0200
committerGitHub <noreply@github.com>2021-06-16 02:46:08 +0200
commitac431ca0763bbbde9ab60de945c9966ed61d9880 (patch)
treebdc6cbc5089cbce1ad4e516465f6ab0dd92f5e8e
parentd7ce3adc8b97ebca61c1f527ea0f9b842d0a2dbe (diff)
fix: closing / aborting WritableStream is racy (#10982)
-rw-r--r--extensions/web/06_streams.js6
-rw-r--r--tools/wpt/expectation.json22
2 files changed, 14 insertions, 14 deletions
diff --git a/extensions/web/06_streams.js b/extensions/web/06_streams.js
index b24ab21a0..be5eca6ba 100644
--- a/extensions/web/06_streams.js
+++ b/extensions/web/06_streams.js
@@ -2808,7 +2808,7 @@
function writableStreamHasOperationMarkedInFlight(stream) {
if (
stream[_inFlightWriteRequest] === undefined &&
- stream[_controller][_inFlightCloseRequest] === undefined
+ stream[_inFlightCloseRequest] === undefined
) {
return false;
}
@@ -2857,11 +2857,11 @@
assert(stream[_storedError] === undefined);
assert(stream[_state] === "writable");
const controller = stream[_controller];
- assert(controller);
+ assert(controller !== undefined);
stream[_state] = "erroring";
stream[_storedError] = reason;
const writer = stream[_writer];
- if (writer) {
+ if (writer !== undefined) {
writableStreamDefaultWriterEnsureReadyPromiseRejected(writer, reason);
}
if (
diff --git a/tools/wpt/expectation.json b/tools/wpt/expectation.json
index 44b19cd5b..8a78f0a35 100644
--- a/tools/wpt/expectation.json
+++ b/tools/wpt/expectation.json
@@ -309,11 +309,6 @@
"queuing-strategies.any.html": true,
"readable-byte-streams": {
"bad-buffers-and-views.any.html": [
- "ReadableStream with byte source: read()ing from a closed stream still transfers the buffer",
- "ReadableStream with byte source: read()ing from a stream with queued chunks still transfers the buffer",
- "ReadableStream with byte source: reading into an already-detached buffer rejects",
- "ReadableStream with byte source: reading into a zero-length buffer rejects",
- "ReadableStream with byte source: reading into a zero-length view on a non-zero-length buffer rejects",
"ReadableStream with byte source: respond() throws if the BYOB request's buffer has been detached (in the readable state)",
"ReadableStream with byte source: respond() throws if the BYOB request's buffer has been detached (in the closed state)",
"ReadableStream with byte source: respondWithNewView() throws if the supplied view's buffer has been detached (in the readable state)",
@@ -326,7 +321,12 @@
"ReadableStream with byte source: respondWithNewView() throws if the supplied view is non-zero-length (in the closed state)",
"ReadableStream with byte source: respondWithNewView() throws if the supplied view's buffer has a different length (in the closed state)",
"ReadableStream with byte source: enqueue() throws if the BYOB request's buffer has been detached (in the readable state)",
- "ReadableStream with byte source: enqueue() throws if the BYOB request's buffer has been detached (in the closed state)"
+ "ReadableStream with byte source: enqueue() throws if the BYOB request's buffer has been detached (in the closed state)",
+ "ReadableStream with byte source: read()ing from a closed stream still transfers the buffer",
+ "ReadableStream with byte source: read()ing from a stream with queued chunks still transfers the buffer",
+ "ReadableStream with byte source: reading into an already-detached buffer rejects",
+ "ReadableStream with byte source: reading into a zero-length buffer rejects",
+ "ReadableStream with byte source: reading into a zero-length view on a non-zero-length buffer rejects"
],
"construct-byob-request.any.html": false,
"general.any.html": [
@@ -424,16 +424,16 @@
"properties.any.html": true,
"reentrant-strategies.any.html": true,
"strategies.any.html": true,
- "terminate.any.html": [
- "controller.terminate() inside flush() should not prevent writer.close() from succeeding"
- ]
+ "terminate.any.html": true
},
"writable-streams": {
- "aborting.any.html": false,
+ "aborting.any.html": true,
"bad-strategies.any.html": true,
"bad-underlying-sinks.any.html": true,
"byte-length-queuing-strategy.any.html": true,
- "close.any.html": false,
+ "close.any.html": [
+ "when close is called on a WritableStream in waiting state, ready should be fulfilled immediately even if close takes a long time"
+ ],
"constructor.any.html": true,
"count-queuing-strategy.any.html": true,
"error.any.html": true,