Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream: fix finished typo #31881

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/internal/streams/end-of-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function eos(stream, opts, callback) {
};

let writableFinished = stream.writableFinished ||
(rState && rState.finished);
(wState && wState.finished);
const onfinish = () => {
writable = false;
writableFinished = true;
Expand Down
12 changes: 11 additions & 1 deletion test/parallel/test-stream-finished.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ testClosed((opts) => new Writable({ write() {}, ...opts }));
}));
}


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated whitespace change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, there was an extra whitespace that shouldn't be there...

{
const r = new Readable({
autoDestroy: false
Expand All @@ -332,3 +331,14 @@ testClosed((opts) => new Writable({ write() {}, ...opts }));
finished(rs, common.mustCall());
}));
}

{
const d = new EE();
d._writableState = {};
d._writableState.finished = true;
finished(d, { readable: false, writable: true }, common.mustCall((err) => {
assert.strictEqual(err, undefined);
}));
d._writableState.errored = true;
d.emit('close');
}