0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 15:06:33 +01:00

stream: fix finished typo

https://github.com/nodejs/node/pull/31509 introduced a slight typo.
Fortunately this typo does not have big impact due to
`isWritableFinished()`.

Fixes: https://github.com/nodejs/node/pull/31509#discussion_r381809355

PR-URL: https://github.com/nodejs/node/pull/31881
Fixes: https://github.com/nodejs/node/issues/31509
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Robert Nagy 2020-02-20 08:31:58 +01:00
parent 2f23918ca5
commit 21bd6679ce
2 changed files with 12 additions and 2 deletions

View File

@ -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;

View File

@ -312,7 +312,6 @@ testClosed((opts) => new Writable({ write() {}, ...opts }));
}));
}
{
const r = new Readable({
autoDestroy: false
@ -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');
}