diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2019-03-26 05:21:27 +0100 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2019-03-30 13:16:39 +0100 |
commit | f86f5736da72ad4f3fb50692461222590e2f0258 (patch) | |
tree | 6fee263bfca24abbf76b7a3f1517b8184c29f077 /benchmark/http | |
parent | f0b3855a90bc5f68fe38ea5e7c69d30ae7d81a27 (diff) | |
download | android-node-v8-f86f5736da72ad4f3fb50692461222590e2f0258.tar.gz android-node-v8-f86f5736da72ad4f3fb50692461222590e2f0258.tar.bz2 android-node-v8-f86f5736da72ad4f3fb50692461222590e2f0258.zip |
benchmark,lib: change var to const
Refs: https://github.com/nodejs/node/pull/26679
PR-URL: https://github.com/nodejs/node/pull/26915
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'benchmark/http')
-rw-r--r-- | benchmark/http/_chunky_http_client.js | 2 | ||||
-rw-r--r-- | benchmark/http/http_server_for_chunky_client.js | 4 | ||||
-rw-r--r-- | benchmark/http/set-header.js | 2 | ||||
-rw-r--r-- | benchmark/http/simple.js | 2 | ||||
-rw-r--r-- | benchmark/http/upgrade.js | 2 |
5 files changed, 5 insertions, 7 deletions
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(); |