From 7347860966b61e792ddf1367dd112a911c668002 Mon Sep 17 00:00:00 2001 From: Jackson Tian Date: Sat, 4 Feb 2017 00:50:12 +0800 Subject: [PATCH] lib: clarify the usage of 'else' The keyword 'else' is unnecessary after 'throw' statements. PR-URL: https://github.com/nodejs/node/pull/11148 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Luigi Pinca Reviewed-By: Franziska Hinkelmann --- lib/child_process.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/child_process.js b/lib/child_process.js index b7fdb5ce8bb53f..cb2cc18440568e 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -30,9 +30,9 @@ exports.fork = function(modulePath /*, args, options*/) { if (pos < arguments.length && arguments[pos] != null) { if (typeof arguments[pos] !== 'object') { throw new TypeError('Incorrect value of args option'); - } else { - options = util._extend({}, arguments[pos++]); } + + options = util._extend({}, arguments[pos++]); } // Prepare arguments for fork: @@ -502,8 +502,8 @@ function execFileSync(/*command, args, options*/) { if (err) throw err; - else - return ret.stdout; + + return ret.stdout; } exports.execFileSync = execFileSync; @@ -522,7 +522,7 @@ function execSync(command /*, options*/) { if (err) throw err; - else - return ret.stdout; + + return ret.stdout; } exports.execSync = execSync;