We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ea8885 commit 1dfbfb5Copy full SHA for 1dfbfb5
1 file changed
lib/internal/streams/writable.js
@@ -397,11 +397,13 @@ function Writable(options) {
397
destroyImpl.construct(this, () => {
398
const state = this._writableState;
399
400
- if (!state.writing) {
+ if ((state.state & kWriting) === 0) {
401
clearBuffer(this, state);
402
}
403
404
- finishMaybe(this, state);
+ if ((state.state & kEnding) !== 0) {
405
+ finishMaybe(stream, state, true);
406
+ }
407
});
408
409
0 commit comments