| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8cda730 commit b5baaa6
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1569,7 +1569,7 @@ E('ERR_SOCKET_BAD_PORT', (name, port, allowZero = true) => { | |||
| 1569 | 1569 | assert(typeof allowZero === 'boolean', | |
| 1570 | 1570 | "The 'allowZero' argument must be of type boolean."); | |
| 1571 | 1571 | const operator = allowZero ? '>=' : '>'; | |
| 1572 | - return `${name} should be ${operator} 0 and < 65536. Received ${port}.`; | ||
| 1572 | + return `${name} should be ${operator} 0 and < 65536. Received ${determineSpecificType(port)}.`; | ||
| 1573 | 1573 | }, RangeError); | |
| 1574 | 1574 | E('ERR_SOCKET_BAD_TYPE', | |
| 1575 | 1575 | 'Bad socket type specified. Valid types are: udp4, udp6', TypeError); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -310,8 +310,6 @@ dns.lookup('', { | |||
| 310 | 310 | const portErr = (port) => { | |
| 311 | 311 | const err = { | |
| 312 | 312 | code: 'ERR_SOCKET_BAD_PORT', | |
| 313 | - message: | ||
| 314 | - `Port should be >= 0 and < 65536. Received ${port}.`, | ||
| 315 | 313 | name: 'RangeError' | |
| 316 | 314 | }; | |
| 317 | 315 | ||
@@ -323,10 +321,7 @@ const portErr = (port) => { | |||
| 323 | 321 | dns.lookupService('0.0.0.0', port, common.mustNotCall()); | |
| 324 | 322 | }, err); | |
| 325 | 323 | }; | |
| 326 | - portErr(null); | ||
| 327 | - portErr(undefined); | ||
| 328 | - portErr(65538); | ||
| 329 | - portErr('test'); | ||
| 324 | + [null, undefined, 65538, 'test', NaN, Infinity, Symbol(), 0n, true, false, '', () => {}, {}].forEach(portErr); | ||
| 330 | 325 | ||
| 331 | 326 | assert.throws(() => { | |
| 332 | 327 | dns.lookupService('0.0.0.0', 80, null); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments