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

lib: remove unnecessary assignments with _extend #11364

Closed
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions lib/_http_agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Agent.prototype.addRequest = function addRequest(req, options) {
}

options = util._extend({}, options);
options = util._extend(options, this.options);
util._extend(options, this.options);

if (!options.servername) {
options.servername = options.host;
Expand Down Expand Up @@ -176,7 +176,7 @@ Agent.prototype.addRequest = function addRequest(req, options) {
Agent.prototype.createSocket = function createSocket(req, options, cb) {
var self = this;
options = util._extend({}, options);
options = util._extend(options, self.options);
util._extend(options, self.options);

if (!options.servername) {
options.servername = options.host;
Expand Down
4 changes: 2 additions & 2 deletions lib/_tls_wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -978,9 +978,9 @@ function normalizeConnectArgs(listArgs) {
// the host/port/path args that it knows about, not the tls options.
// This means that options.host overrides a host arg.
if (listArgs[1] !== null && typeof listArgs[1] === 'object') {
options = util._extend(options, listArgs[1]);
util._extend(options, listArgs[1]);
} else if (listArgs[2] !== null && typeof listArgs[2] === 'object') {
options = util._extend(options, listArgs[2]);
util._extend(options, listArgs[2]);
}

return (cb) ? [options, cb] : [options];
Expand Down
2 changes: 1 addition & 1 deletion lib/child_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ exports.execFile = function(file /*, args, options, callback*/) {
}

if (pos < arguments.length && typeof arguments[pos] === 'object') {
options = util._extend(options, arguments[pos++]);
util._extend(options, arguments[pos++]);
} else if (pos < arguments.length && arguments[pos] == null) {
pos++;
}
Expand Down
6 changes: 3 additions & 3 deletions lib/internal/cluster/master.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ cluster.setupMaster = function(options) {
execArgv: process.execArgv,
silent: false
};
settings = util._extend(settings, cluster.settings);
settings = util._extend(settings, options || {});
util._extend(settings, cluster.settings);
util._extend(settings, options || {});

// Tell V8 to write profile data for each process to a separate file.
// Without --logfile=v8-%p.log, everything ends up in a single, unusable
Expand Down Expand Up @@ -110,7 +110,7 @@ function createWorkerProcess(id, env) {
var execArgv = cluster.settings.execArgv.slice();
var debugPort = 0;

workerEnv = util._extend(workerEnv, env);
util._extend(workerEnv, env);
workerEnv.NODE_UNIQUE_ID = '' + id;

for (var i = 0; i < execArgv.length; i++) {
Expand Down