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: https://github.com/nodejs/node/pull/10041
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Ethan Arrowood 2016-12-01 11:48:07 -06:00 committed by Luigi Pinca
parent f3cf8e9808
commit e432c2bfaa

View File

@ -56,8 +56,8 @@ function getOptions(options, defaultOptions) {
return options;
}
function copyObject(source, target) {
target = arguments.length >= 2 ? target : {};
function copyObject(source) {
const target = {};
for (const key in source)
target[key] = source[key];
return target;