From f86f5736da72ad4f3fb50692461222590e2f0258 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Tue, 26 Mar 2019 05:21:27 +0100 Subject: benchmark,lib: change var to const MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs: https://github.com/nodejs/node/pull/26679 PR-URL: https://github.com/nodejs/node/pull/26915 Reviewed-By: Michaël Zasso Reviewed-By: Tobias Nießen Reviewed-By: Refael Ackermann --- benchmark/http/_chunky_http_client.js | 2 +- benchmark/http/http_server_for_chunky_client.js | 4 +--- benchmark/http/set-header.js | 2 +- benchmark/http/simple.js | 2 +- benchmark/http/upgrade.js | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) (limited to 'benchmark/http') diff --git a/benchmark/http/_chunky_http_client.js b/benchmark/http/_chunky_http_client.js index 21418a7c26..5164f8c619 100644 --- a/benchmark/http/_chunky_http_client.js +++ b/benchmark/http/_chunky_http_client.js @@ -54,7 +54,7 @@ function main({ len, n }) { const add = 11; var count = 0; const PIPE = process.env.PIPE_NAME; - var socket = net.connect(PIPE, () => { + const socket = net.connect(PIPE, () => { bench.start(); WriteHTTPHeaders(socket, 1, len); socket.setEncoding('utf8'); diff --git a/benchmark/http/http_server_for_chunky_client.js b/benchmark/http/http_server_for_chunky_client.js index edcacf5d12..ef0a23a029 100644 --- a/benchmark/http/http_server_for_chunky_client.js +++ b/benchmark/http/http_server_for_chunky_client.js @@ -10,9 +10,7 @@ process.env.PIPE_NAME = PIPE; tmpdir.refresh(); -var server; - -server = http.createServer((req, res) => { +const server = http.createServer((req, res) => { const headers = { 'content-type': 'text/plain', 'content-length': '2' diff --git a/benchmark/http/set-header.js b/benchmark/http/set-header.js index 01cd8492df..1909c0991d 100644 --- a/benchmark/http/set-header.js +++ b/benchmark/http/set-header.js @@ -17,7 +17,7 @@ const c = 50; // setHeaderWH: setHeader(...), writeHead(status, ...) function main({ res }) { process.env.PORT = PORT; - var server = require('../fixtures/simple-http-server.js') + const server = require('../fixtures/simple-http-server.js') .listen(PORT) .on('listening', () => { const path = `/${type}/${len}/${chunks}/normal/${chunkedEnc}`; diff --git a/benchmark/http/simple.js b/benchmark/http/simple.js index 2d89dce9be..95409faa9a 100644 --- a/benchmark/http/simple.js +++ b/benchmark/http/simple.js @@ -11,7 +11,7 @@ const bench = common.createBenchmark(main, { }); function main({ type, len, chunks, c, chunkedEnc, res }) { - var server = require('../fixtures/simple-http-server.js') + const server = require('../fixtures/simple-http-server.js') .listen(common.PORT) .on('listening', () => { const path = `/${type}/${len}/${chunks}/normal/${chunkedEnc}`; diff --git a/benchmark/http/upgrade.js b/benchmark/http/upgrade.js index c286cdb264..8d365fe46d 100644 --- a/benchmark/http/upgrade.js +++ b/benchmark/http/upgrade.js @@ -19,7 +19,7 @@ const resData = 'HTTP/1.1 101 Web Socket Protocol Handshake\r\n' + '\r\n\r\n'; function main({ n }) { - var server = require('../fixtures/simple-http-server.js') + const server = require('../fixtures/simple-http-server.js') .listen(common.PORT) .on('listening', () => { bench.start(); -- cgit v1.2.3