fix: closing / aborting WritableStream is racy (#10982)

This commit is contained in:
Luca Casonato 2021-06-16 02:46:08 +02:00 committed by GitHub
parent d7ce3adc8b
commit ac431ca076
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 14 deletions

View file

@ -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 (