Skip to content

Commit

Permalink
lib: removes unnecessary params
Browse files Browse the repository at this point in the history
PR-URL: #32694
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
  • Loading branch information
JesuHrz authored and himself65 committed Apr 10, 2020
1 parent 203776f commit 4076e04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/internal/fs/dir.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class Dir {
);
}

readSync(options) {
readSync() {
if (this[kDirClosed] === true) {
throw new ERR_DIR_CLOSED();
}
Expand Down
6 changes: 3 additions & 3 deletions lib/internal/fs/promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function validateFileHandle(handle) {
throw new ERR_INVALID_ARG_TYPE('filehandle', 'FileHandle', handle);
}

async function writeFileHandle(filehandle, data, options) {
async function writeFileHandle(filehandle, data) {
let remaining = data.length;
if (remaining === 0) return;
do {
Expand Down Expand Up @@ -514,10 +514,10 @@ async function writeFile(path, data, options) {
}

if (path instanceof FileHandle)
return writeFileHandle(path, data, options);
return writeFileHandle(path, data);

const fd = await open(path, flag, options.mode);
return writeFileHandle(fd, data, options).finally(fd.close);
return writeFileHandle(fd, data).finally(fd.close);
}

async function appendFile(path, data, options) {
Expand Down

0 comments on commit 4076e04

Please sign in to comment.