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: nodejs#29177
  • Loading branch information
gntem committed Aug 19, 2019
1 parent 9b7362c commit df1ba97
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 @@ -65,7 +65,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 @@ -241,7 +243,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 df1ba97

Please sign in to comment.