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:
parent
ceace1f96e
commit
eeea3fb91b
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user