File tree Expand file tree Collapse file tree 1 file changed +17
-18
lines changed
Expand file tree Collapse file tree 1 file changed +17
-18
lines changed Original file line number Diff line number Diff line change @@ -57,26 +57,25 @@ exports.createServer = function(opts, requestListener) {
5757
5858// HTTPS agents.
5959
60- function createConnection ( /* [port, host, options] */ ) {
61- var options = { } ;
62-
63- if ( typeof arguments [ 0 ] === 'object' ) {
64- options = arguments [ 0 ] ;
65- } else if ( typeof arguments [ 1 ] === 'object' ) {
66- options = arguments [ 1 ] ;
67- options . port = arguments [ 0 ] ;
68- } else if ( typeof arguments [ 2 ] === 'object' ) {
69- options = arguments [ 2 ] ;
70- options . port = arguments [ 0 ] ;
71- options . host = arguments [ 1 ] ;
60+ function createConnection ( port , host , options ) {
61+ if ( typeof port === 'object' ) {
62+ options = port ;
63+ } else if ( typeof host === 'object' ) {
64+ options = host ;
65+ } else if ( typeof options === 'object' ) {
66+ options = options ;
7267 } else {
73- if ( typeof arguments [ 0 ] === 'number' ) {
74- options . port = arguments [ 0 ] ;
75- }
76- if ( typeof arguments [ 1 ] === 'string' ) {
77- options . host = arguments [ 1 ] ;
78- }
68+ options = { } ;
69+ }
70+
71+ if ( typeof port === 'number' ) {
72+ options . port = port ;
7973 }
74+
75+ if ( typeof host === 'string' ) {
76+ options . host = host ;
77+ }
78+
8079 return tls . connect ( options ) ;
8180}
8281
You can’t perform that action at this time.
0 commit comments