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:
parent
2f23918ca5
commit
21bd6679ce
@ -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;
|
||||
|
@ -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');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user