File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -1167,9 +1167,18 @@ function writableStreamDefaultControllerGetDesiredSize(controller) {
11671167
}
11681168

11691169
function writableStreamDefaultControllerGetChunkSize(controller, chunk) {
1170+
const {
1171+
stream,
1172+
sizeAlgorithm,
1173+
} = controller[kState];
1174+
if (sizeAlgorithm === undefined) {
1175+
assert(stream[kState].state === 'errored' || stream[kState].state === 'erroring');
1176+
return 1;
1177+
}
1178+
11701179
try {
11711180
return FunctionCall(
1172-
controller[kState].sizeAlgorithm,
1181+
sizeAlgorithm,
11731182
undefined,
11741183
chunk);
11751184
} catch (error) {

0 commit comments

Comments
 (0)