Skip to content

Commit 2673be6

Browse files
Ethan-ArrowoodMylesBorins
authored andcommitted
fs: remove unused argument from copyObject()
The fs function copyObject() had two arguments: source and target. On the first line of the function it assigned the target variable to: arguments.length >= 2 ? target : {}; The function copyObject() was not called directly by any test, but it is called in other fs functions. When it was called it was only ever called with a single argument, source. Thus I have removed the target argument and assigned it to an empty object like it was being assigned to in the original ternary operator. PR-URL: #10041 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 2da71f2 commit 2673be6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/fs.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ function getOptions(options, defaultOptions) {
5656
return options;
5757
}
5858

59-
function copyObject(source, target) {
60-
target = arguments.length >= 2 ? target : {};
59+
function copyObject(source) {
60+
const target = {};
6161
for (const key in source)
6262
target[key] = source[key];
6363
return target;

0 commit comments

Comments
 (0)