GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — stream: validate undefined sizeAlgorithm in WritableStream · nodejs/node@fe5f7bc

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/webstreams
    • writablestream.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/webstreams/writablestream.js‎

Copy file name to clipboardExpand all lines: lib/internal/webstreams/writablestream.js
+10-1Lines changed: 10 additions & 1 deletion
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 FunctionPrototypeCall(
1172-
controller[kState].sizeAlgorithm,
1181+
sizeAlgorithm,
11731182
undefined,
11741183
chunk);
11751184
} catch (error) {

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.