Skip to content

Commit 57016b9

Browse files
benglMylesBorins
authored andcommitted
fs: use async writeFile in FileHandle#appendFile
When operating on a FileHandle, the file has already been opened with the flag given as an option to fs.promises.open(). This means defaulting to 'a' has no effect here, and FileHandle#appendFile turns out to exactly be an alias of writeFile. This is now explicit, saving a stack frame, object copy and assignment. PR-URL: #31235 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Anto Aravinth <[email protected]>
1 parent ca51ff8 commit 57016b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/fs/promises.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class FileHandle {
7070
}
7171

7272
appendFile(data, options) {
73-
return appendFile(this, data, options);
73+
return writeFile(this, data, options);
7474
}
7575

7676
chmod(mode) {

0 commit comments

Comments
 (0)