Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8f47ff1

Browse filesBrowse files
gntemBridgeAR
authored andcommitted
fs: allow passing true to emitClose option
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>
1 parent 12cbb3f commit 8f47ff1
Copy full SHA for 8f47ff1

File tree

Expand file treeCollapse file tree

1 file changed

+6
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-2
lines changed
Open diff view settings
Collapse file

‎lib/internal/fs/streams.js‎

Copy file name to clipboardExpand all lines: lib/internal/fs/streams.js
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ function ReadStream(path, options) {
6161
options.highWaterMark = 64 * 1024;
6262

6363
// For backwards compat do not emit close on destroy.
64-
options.emitClose = false;
64+
if (options.emitClose === undefined) {
65+
options.emitClose = false;
66+
}
6567

6668
Readable.call(this, options);
6769

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

239241
// For backwards compat do not emit close on destroy.
240-
options.emitClose = false;
242+
if (options.emitClose === undefined) {
243+
options.emitClose = false;
244+
}
241245

242246
Writable.call(this, options);
243247

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.