mirror of
https://github.com/nodejs/node.git
synced 2025-05-08 06:26:24 +00:00

In document, `autoSelectFamilyAttemptTimeout` is described as positive integer because it's time unit. But there is no checking whether it's positive integer. PR-URL: https://github.com/nodejs/node/pull/45740 Refs: https://github.com/nodejs/node/blob/main/doc/api/net.md#socketconnectoptions-connectlistener Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
15 lines
330 B
JavaScript
15 lines
330 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const net = require('net');
|
|
|
|
for (const autoSelectFamilyAttemptTimeout of [-10, 0]) {
|
|
assert.throws(() => {
|
|
net.connect({
|
|
port: 8080,
|
|
autoSelectFamily: true,
|
|
autoSelectFamilyAttemptTimeout,
|
|
});
|
|
}, { code: 'ERR_OUT_OF_RANGE' });
|
|
}
|