diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2017-09-13 22:48:53 -0300 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2017-09-19 21:14:38 -0300 |
commit | e167ab71fb113fa38866dd11aa99af7079fb463c (patch) | |
tree | 3d91ca0f6e60d08fcab70833b851335e41b53cd0 /benchmark/url | |
parent | b1c8f15c5f169e021f7c46eb7b219de95fe97603 (diff) | |
download | node-new-e167ab71fb113fa38866dd11aa99af7079fb463c.tar.gz |
benchmark: var to const
PR-URL: https://github.com/nodejs/node/pull/13757
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'benchmark/url')
-rw-r--r-- | benchmark/url/legacy-vs-whatwg-url-get-prop.js | 8 | ||||
-rw-r--r-- | benchmark/url/legacy-vs-whatwg-url-serialize.js | 4 | ||||
-rw-r--r-- | benchmark/url/url-searchparams-iteration.js | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/benchmark/url/legacy-vs-whatwg-url-get-prop.js b/benchmark/url/legacy-vs-whatwg-url-get-prop.js index 733a05a173..229a4e6065 100644 --- a/benchmark/url/legacy-vs-whatwg-url-get-prop.js +++ b/benchmark/url/legacy-vs-whatwg-url-get-prop.js @@ -16,8 +16,8 @@ const bench = common.createBenchmark(main, { // remains a constant in the function, so here we must use the literal // instead to get a LoadNamedField. function useLegacy(n, input) { - var obj = url.parse(input); - var noDead = { + const obj = url.parse(input); + const noDead = { protocol: obj.protocol, auth: obj.auth, host: obj.host, @@ -45,8 +45,8 @@ function useLegacy(n, input) { } function useWHATWG(n, input) { - var obj = new URL(input); - var noDead = { + const obj = new URL(input); + const noDead = { protocol: obj.protocol, auth: `${obj.username}:${obj.password}`, host: obj.host, diff --git a/benchmark/url/legacy-vs-whatwg-url-serialize.js b/benchmark/url/legacy-vs-whatwg-url-serialize.js index 911e79794b..35b459a10c 100644 --- a/benchmark/url/legacy-vs-whatwg-url-serialize.js +++ b/benchmark/url/legacy-vs-whatwg-url-serialize.js @@ -12,7 +12,7 @@ const bench = common.createBenchmark(main, { }); function useLegacy(n, input, prop) { - var obj = url.parse(input); + const obj = url.parse(input); var noDead = url.format(obj); bench.start(); for (var i = 0; i < n; i += 1) { @@ -23,7 +23,7 @@ function useLegacy(n, input, prop) { } function useWHATWG(n, input, prop) { - var obj = new URL(input); + const obj = new URL(input); var noDead = obj.toString(); bench.start(); for (var i = 0; i < n; i += 1) { diff --git a/benchmark/url/url-searchparams-iteration.js b/benchmark/url/url-searchparams-iteration.js index 89919af725..0f4b71a0a1 100644 --- a/benchmark/url/url-searchparams-iteration.js +++ b/benchmark/url/url-searchparams-iteration.js @@ -33,7 +33,7 @@ function iterator(n) { bench.start(); for (var i = 0; i < n; i += 1) { - for (var pair of params) { + for (const pair of params) { noDead[0] = pair[0]; noDead[1] = pair[1]; } |