Skip to content

Commit

Permalink
tls: fix/annotate connect arg comments
Browse files Browse the repository at this point in the history
PR-URL: #9800
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
  • Loading branch information
sam-github authored and MylesBorins committed Jan 31, 2017
1 parent b2b2774 commit 89db5fc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/_tls_wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,11 @@ function normalizeConnectArgs(listArgs) {
var options = args[0];
var cb = args[1];

// If args[0] was options, then normalize dealt with it.
// If args[0] is port, or args[0], args[1] is host,port, we need to
// find the options and merge them in, normalize's options has only
// 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]);
} else if (listArgs[2] !== null && typeof listArgs[2] === 'object') {
Expand All @@ -984,7 +989,7 @@ function normalizeConnectArgs(listArgs) {
return (cb) ? [options, cb] : [options];
}

exports.connect = function(/* [port, host], options, cb */) {
exports.connect = function(/* [port,] [host,] [options,] [cb] */) {
const argsLen = arguments.length;
var args = new Array(argsLen);
for (var i = 0; i < argsLen; i++)
Expand Down

0 comments on commit 89db5fc

Please sign in to comment.