Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

child_process: charify the usage of 'else' #11148

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/child_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,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++]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change means we access an out-of-bounds pos on arguments, which recent PRs have claimed is a deoptimization. Any concern with that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #10323 for more context on my comment above

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's actually a potentially out of bounds check immediately above. I'd recommend going through in a separate PR and dealing with those.

}

// Prepare arguments for fork:
Expand Down Expand Up @@ -581,8 +581,8 @@ function execFileSync(/*command, args, options*/) {

if (err)
throw err;
else
return ret.stdout;

return ret.stdout;
}
exports.execFileSync = execFileSync;

Expand All @@ -601,8 +601,8 @@ function execSync(command /*, options*/) {

if (err)
throw err;
else
return ret.stdout;

return ret.stdout;
}
exports.execSync = execSync;

Expand Down