benchmark: fix variables not being set

Due to the destructuring the outer variables were not set anymore.

PR-URL: https://github.com/nodejs/node/pull/18320
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Ruben Bridgewater 2018-01-23 13:15:59 +01:00
parent d4015b8995
commit f951c9a9f0
No known key found for this signature in database
GPG Key ID: F07496B3EB3C1762

View File

@ -11,12 +11,13 @@ const bench = common.createBenchmark(main, {
var clientConn = 0;
var serverConn = 0;
var server;
var dur;
var concurrency;
var running = true;
function main({ dur, concurrency }) {
function main(conf) {
dur = conf.dur;
concurrency = conf.concurrency;
const cert_dir = path.resolve(__dirname, '../../test/fixtures');
const options = {
key: fs.readFileSync(`${cert_dir}/test_key.pem`),
@ -25,7 +26,7 @@ function main({ dur, concurrency }) {
ciphers: 'AES256-GCM-SHA384'
};
server = tls.createServer(options, onConnection);
const server = tls.createServer(options, onConnection);
server.listen(common.PORT, onListening);
}