Skip to content

Commit 080852c

Browse files
authored
Fix assertion when writing to a closed writable stream
Closes #1341.
1 parent 4d90f7f commit 080852c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

index.bs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5401,8 +5401,8 @@ The following abstract operations support the implementation of the
54015401
|chunk|)</dfn> performs the following steps:
54025402

54035403
1. If |controller|.[=WritableStreamDefaultController/[[strategySizeAlgorithm]]=] is undefined, then:
5404-
1. Assert: |controller|.[=WritableStreamDefaultController/[[stream]]=].[=WritableStream/[[state]]=] is "`erroring`" or
5405-
"`errored`".
5404+
1. Assert: |controller|.[=WritableStreamDefaultController/[[stream]]=].[=WritableStream/[[state]]=] is not
5405+
"`writable`".
54065406
1. Return 1.
54075407
1. Let |returnValue| be the result of performing
54085408
|controller|.[=WritableStreamDefaultController/[[strategySizeAlgorithm]]=], passing in |chunk|,

reference-implementation/lib/abstract-ops/writable-streams.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ function WritableStreamDefaultControllerGetBackpressure(controller) {
663663

664664
function WritableStreamDefaultControllerGetChunkSize(controller, chunk) {
665665
if (controller._strategySizeAlgorithm === undefined) {
666-
assert(controller._stream._state === 'erroring' || controller._stream._state === 'errored');
666+
assert(controller._stream._state !== 'writable');
667667
return 1;
668668
}
669669

0 commit comments

Comments
 (0)