0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

fs: allow passing true to emitClose option

Allow passing true for emitClose option for fs
streams.

Fixes: https://github.com/nodejs/node/issues/29177

PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Giorgos Ntemiris 2019-08-19 21:03:21 +02:00 committed by Rich Trott
parent ceace1f96e
commit eeea3fb91b

View File

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