summaryrefslogtreecommitdiff
path: root/benchmark/url/url-searchparams-iteration.js
diff options
context:
space:
mode:
authorSergey Golovin <golovim@gmail.com>2018-03-02 16:23:16 +0300
committerRuben Bridgewater <ruben@bridgewater.de>2018-03-11 03:56:17 +0100
commitf3257dd3ead29e620b2bc096d54b07b12ec5c5a3 (patch)
tree1f8e7844f651e7295b24dd58b1d1cfd2d4aaac17 /benchmark/url/url-searchparams-iteration.js
parent2f743261814d428b935136b64b416a2879c29364 (diff)
downloadandroid-node-v8-f3257dd3ead29e620b2bc096d54b07b12ec5c5a3.tar.gz
android-node-v8-f3257dd3ead29e620b2bc096d54b07b12ec5c5a3.tar.bz2
android-node-v8-f3257dd3ead29e620b2bc096d54b07b12ec5c5a3.zip
benchmark: fix benchmark for url
Rename different parameters with the same names to make it possible to run tests for url benchmarks. PR-URL: https://github.com/nodejs/node/pull/19084 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'benchmark/url/url-searchparams-iteration.js')
-rw-r--r--benchmark/url/url-searchparams-iteration.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/benchmark/url/url-searchparams-iteration.js b/benchmark/url/url-searchparams-iteration.js
index cae2ef5df6..244c95502b 100644
--- a/benchmark/url/url-searchparams-iteration.js
+++ b/benchmark/url/url-searchparams-iteration.js
@@ -4,7 +4,7 @@ const assert = require('assert');
const { URLSearchParams } = require('url');
const bench = common.createBenchmark(main, {
- method: ['forEach', 'iterator'],
+ loopMethod: ['forEach', 'iterator'],
n: [1e6]
});
@@ -44,8 +44,8 @@ function iterator(n) {
assert.strictEqual(noDead[1], '3rd');
}
-function main({ method, n }) {
- switch (method) {
+function main({ loopMethod, n }) {
+ switch (loopMethod) {
case 'forEach':
forEach(n);
break;
@@ -53,6 +53,6 @@ function main({ method, n }) {
iterator(n);
break;
default:
- throw new Error(`Unknown method ${method}`);
+ throw new Error(`Unknown method ${loopMethod}`);
}
}