We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5083bbb commit fe5f7bcCopy full SHA for fe5f7bc
lib/internal/webstreams/writablestream.js
@@ -1167,9 +1167,18 @@ function writableStreamDefaultControllerGetDesiredSize(controller) {
1167
}
1168
1169
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
+
1179
try {
1180
return FunctionPrototypeCall(
- controller[kState].sizeAlgorithm,
1181
1182
undefined,
1183
chunk);
1184
} catch (error) {
0 commit comments