Skip to content

Commit

Permalink
fs: allow passing true to emitClose option
Browse files Browse the repository at this point in the history
Allow passing true for emitClose option for fs
streams.

Fixes: #29177

PR-URL: #29212
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
gntem authored and Trott committed Aug 23, 2019
1 parent ceace1f commit eeea3fb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/internal/fs/streams.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ function ReadStream(path, options) {
options.highWaterMark = 64 * 1024;

// For backwards compat do not emit close on destroy.
options.emitClose = false;
if (options.emitClose === undefined) {
options.emitClose = false;
}

Readable.call(this, options);

Expand Down Expand Up @@ -237,7 +239,9 @@ function WriteStream(path, options) {
options = copyObject(getOptions(options, {}));

// For backwards compat do not emit close on destroy.
options.emitClose = false;
if (options.emitClose === undefined) {
options.emitClose = false;
}

Writable.call(this, options);

Expand Down

0 comments on commit eeea3fb

Please sign in to comment.