Skip to content

Commit 7347860

Browse files
JacksonTianMylesBorins
authored andcommitted
lib: clarify the usage of 'else'
The keyword 'else' is unnecessary after 'throw' statements. PR-URL: #11148 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
1 parent ac92d02 commit 7347860

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/child_process.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ exports.fork = function(modulePath /*, args, options*/) {
3030
if (pos < arguments.length && arguments[pos] != null) {
3131
if (typeof arguments[pos] !== 'object') {
3232
throw new TypeError('Incorrect value of args option');
33-
} else {
34-
options = util._extend({}, arguments[pos++]);
3533
}
34+
35+
options = util._extend({}, arguments[pos++]);
3636
}
3737

3838
// Prepare arguments for fork:
@@ -502,8 +502,8 @@ function execFileSync(/*command, args, options*/) {
502502

503503
if (err)
504504
throw err;
505-
else
506-
return ret.stdout;
505+
506+
return ret.stdout;
507507
}
508508
exports.execFileSync = execFileSync;
509509

@@ -522,7 +522,7 @@ function execSync(command /*, options*/) {
522522

523523
if (err)
524524
throw err;
525-
else
526-
return ret.stdout;
525+
526+
return ret.stdout;
527527
}
528528
exports.execSync = execSync;

0 commit comments

Comments
 (0)