| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -54,7 +54,10 @@ const { | |||
| 54 | 54 | ERR_OUT_OF_RANGE, | |
| 55 | 55 | }, | |
| 56 | 56 | } = require('internal/errors'); | |
| 57 | - const { once } = require('internal/util'); | ||
| 57 | + const { | ||
| 58 | + kEmptyObject, | ||
| 59 | + once, | ||
| 60 | + } = require('internal/util'); | ||
| 58 | 61 | const { | |
| 59 | 62 | validateNumber, | |
| 60 | 63 | validateOneOf, | |
@@ -220,7 +223,7 @@ Agent.defaultMaxSockets = Infinity; | |||
| 220 | 223 | Agent.prototype.createConnection = net.createConnection; | |
| 221 | 224 | ||
| 222 | 225 | // Get the key for a given set of request options | |
| 223 | - Agent.prototype.getName = function getName(options = {}) { | ||
| 226 | + Agent.prototype.getName = function getName(options = kEmptyObject) { | ||
| 224 | 227 | let name = options.host || 'localhost'; | |
| 225 | 228 | ||
| 226 | 229 | name += ':'; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -43,7 +43,10 @@ const { | |||
| 43 | 43 | ||
| 44 | 44 | const net = require('net'); | |
| 45 | 45 | const assert = require('internal/assert'); | |
| 46 | - const { once } = require('internal/util'); | ||
| 46 | + const { | ||
| 47 | + kEmptyObject, | ||
| 48 | + once, | ||
| 49 | + } = require('internal/util'); | ||
| 47 | 50 | const { | |
| 48 | 51 | _checkIsHttpToken: checkIsHttpToken, | |
| 49 | 52 | freeParser, | |
@@ -133,7 +136,7 @@ function ClientRequest(input, options, cb) { | |||
| 133 | 136 | ||
| 134 | 137 | if (typeof options === 'function') { | |
| 135 | 138 | cb = options; | |
| 136 | - options = input || {}; | ||
| 139 | + options = input || kEmptyObject; | ||
| 137 | 140 | } else { | |
| 138 | 141 | options = ObjectAssign(input || {}, options); | |
| 139 | 142 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments