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: make checking pendingcb on WritableStream backward compatible · nodejs/node@337cd41

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/streams
    • end-of-stream.js
  • test/parallel
    • test-stream-finished.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/streams/end-of-stream.js‎

Copy file name to clipboardExpand all lines: lib/internal/streams/end-of-stream.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ function eos(stream, options, callback) {
215215
!readable &&
216216
(!willEmitClose || isReadable(stream)) &&
217217
(writableFinished || isWritable(stream) === false) &&
218-
(wState == null || wState.pendingcb === 0)
218+
(wState == null || wState.pendingcb === undefined || wState.pendingcb === 0)
219219
) {
220220
process.nextTick(onclosed);
221221
} else if (
Collapse file

‎test/parallel/test-stream-finished.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-stream-finished.js
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,3 +687,16 @@ testClosed((opts) => new Writable({ write() {}, ...opts }));
687687
assert.strictEqual(stream._writableState.pendingcb, 0);
688688
}));
689689
}
690+
691+
{
692+
const stream = new Duplex({
693+
write(chunk, enc, cb) {}
694+
});
695+
696+
stream.end('foo');
697+
698+
// Simulate an old stream implementation that doesn't have pendingcb
699+
delete stream._writableState.pendingcb;
700+
701+
finished(stream, { readable: false }, common.mustCall());
702+
}

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.