From 2673be676aaa88490c9b72fdf08a22a8bb8db37f Mon Sep 17 00:00:00 2001 From: Ethan Arrowood Date: Thu, 1 Dec 2016 11:48:07 -0600 Subject: [PATCH] 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 Reviewed-By: Sakthipriyan Vairamani Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- lib/fs.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fs.js b/lib/fs.js index 27614e5cf1febc..12ba9b8dba790f 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -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;