| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 53ecd20 commit 3d1dd96
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,7 +30,6 @@ const { | |||
| 30 | 30 | ArrayPrototypeSome, | |
| 31 | 31 | ArrayPrototypeSplice, | |
| 32 | 32 | FunctionPrototypeCall, | |
| 33 | - NumberIsNaN, | ||
| 34 | 33 | ObjectCreate, | |
| 35 | 34 | ObjectKeys, | |
| 36 | 35 | ObjectSetPrototypeOf, | |
@@ -49,11 +48,6 @@ let debug = require('internal/util/debuglog').debuglog('http', (fn) => { | |||
| 49 | 48 | }); | |
| 50 | 49 | const { AsyncResource } = require('async_hooks'); | |
| 51 | 50 | const { async_id_symbol } = require('internal/async_hooks').symbols; | |
| 52 | - const { | ||
| 53 | - codes: { | ||
| 54 | - ERR_OUT_OF_RANGE, | ||
| 55 | - }, | ||
| 56 | - } = require('internal/errors'); | ||
| 57 | 51 | const { | |
| 58 | 52 | kEmptyObject, | |
| 59 | 53 | once, | |
@@ -123,10 +117,7 @@ function Agent(options) { | |||
| 123 | 117 | validateOneOf(this.scheduling, 'scheduling', ['fifo', 'lifo']); | |
| 124 | 118 | ||
| 125 | 119 | if (this.maxTotalSockets !== undefined) { | |
| 126 | - validateNumber(this.maxTotalSockets, 'maxTotalSockets'); | ||
| 127 | - if (this.maxTotalSockets <= 0 || NumberIsNaN(this.maxTotalSockets)) | ||
| 128 | - throw new ERR_OUT_OF_RANGE('maxTotalSockets', '> 0', | ||
| 129 | - this.maxTotalSockets); | ||
| 120 | + validateNumber(this.maxTotalSockets, 'maxTotalSockets', 1); | ||
| 130 | 121 | } else { | |
| 131 | 122 | this.maxTotalSockets = Infinity; | |
| 132 | 123 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,8 +20,6 @@ assert.throws(() => new http.Agent({ | |||
| 20 | 20 | }), { | |
| 21 | 21 | code: 'ERR_OUT_OF_RANGE', | |
| 22 | 22 | name: 'RangeError', | |
| 23 | - message: 'The value of "maxTotalSockets" is out of range. ' + | ||
| 24 | - `It must be > 0. Received ${item}`, | ||
| 25 | 23 | }); | |
| 26 | 24 | }); | |
| 27 | 25 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments