summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine du Hamel <duhamelantoine1995@gmail.com>2023-02-10 01:54:40 +0100
committerGitHub <noreply@github.com>2023-02-10 00:54:40 +0000
commit3aef395ed51e7457fff01f38c08c1cac88e7c3e8 (patch)
tree3a6cd07398e565a83b5d83a8952edee06dc34cda
parent71646e2eca2cb93ad592cce5e5a20ce15cb7e215 (diff)
downloadnode-new-3aef395ed51e7457fff01f38c08c1cac88e7c3e8.tar.gz
benchmark: add trailing commas in `benchmark/url`
PR-URL: https://github.com/nodejs/node/pull/46551 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
-rw-r--r--benchmark/.eslintrc.yaml1
-rw-r--r--benchmark/url/legacy-vs-whatwg-url-get-prop.js6
-rw-r--r--benchmark/url/legacy-vs-whatwg-url-parse.js2
-rw-r--r--benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js2
-rw-r--r--benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js2
-rw-r--r--benchmark/url/legacy-vs-whatwg-url-serialize.js2
-rw-r--r--benchmark/url/url-format.js2
-rw-r--r--benchmark/url/url-parse.js4
-rw-r--r--benchmark/url/url-resolve.js4
-rw-r--r--benchmark/url/url-searchparams-iteration.js2
-rw-r--r--benchmark/url/url-searchparams-read.js2
-rw-r--r--benchmark/url/url-searchparams-sort.js6
-rw-r--r--benchmark/url/usvstring.js6
-rw-r--r--benchmark/url/whatwg-url-idna.js14
-rw-r--r--benchmark/url/whatwg-url-properties.js2
15 files changed, 28 insertions, 29 deletions
diff --git a/benchmark/.eslintrc.yaml b/benchmark/.eslintrc.yaml
index 18e63380b0..9ca9639223 100644
--- a/benchmark/.eslintrc.yaml
+++ b/benchmark/.eslintrc.yaml
@@ -12,7 +12,6 @@ overrides:
- crypto/*.js
- http/*.js
- path/*.js
- - url/*.js
rules:
comma-dangle: [error, {
arrays: always-multiline,
diff --git a/benchmark/url/legacy-vs-whatwg-url-get-prop.js b/benchmark/url/legacy-vs-whatwg-url-get-prop.js
index fe0c464f52..df888f13b9 100644
--- a/benchmark/url/legacy-vs-whatwg-url-get-prop.js
+++ b/benchmark/url/legacy-vs-whatwg-url-get-prop.js
@@ -7,7 +7,7 @@ const assert = require('assert');
const bench = common.createBenchmark(main, {
type: common.urlDataTypes,
method: ['legacy', 'whatwg'],
- e: [1]
+ e: [1],
});
function useLegacy(data) {
@@ -20,7 +20,7 @@ function useLegacy(data) {
port: obj.port,
pathname: obj.pathname,
search: obj.search,
- hash: obj.hash
+ hash: obj.hash,
};
const len = data.length;
// It's necessary to assign the values to an object
@@ -51,7 +51,7 @@ function useWHATWG(data) {
port: obj.port,
pathname: obj.pathname,
search: obj.search,
- hash: obj.hash
+ hash: obj.hash,
};
const len = data.length;
bench.start();
diff --git a/benchmark/url/legacy-vs-whatwg-url-parse.js b/benchmark/url/legacy-vs-whatwg-url-parse.js
index 94115d1305..a54d81e15f 100644
--- a/benchmark/url/legacy-vs-whatwg-url-parse.js
+++ b/benchmark/url/legacy-vs-whatwg-url-parse.js
@@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, {
withBase: ['true', 'false'],
type: common.urlDataTypes,
e: [1],
- method: ['legacy', 'whatwg']
+ method: ['legacy', 'whatwg'],
});
function useLegacy(data) {
diff --git a/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js b/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js
index fc21ea7c85..fb2ce8ffa7 100644
--- a/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js
+++ b/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js
@@ -6,7 +6,7 @@ const searchParams = common.searchParams;
const bench = common.createBenchmark(main, {
searchParam: Object.keys(searchParams),
method: ['legacy', 'whatwg'],
- n: [1e6]
+ n: [1e6],
});
function useLegacy(n, input) {
diff --git a/benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js b/benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js
index b9c2861719..171a8838a3 100644
--- a/benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js
+++ b/benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js
@@ -6,7 +6,7 @@ const searchParams = common.searchParams;
const bench = common.createBenchmark(main, {
searchParam: Object.keys(searchParams),
method: ['legacy', 'whatwg'],
- n: [1e6]
+ n: [1e6],
});
function useLegacy(n, input, prop) {
diff --git a/benchmark/url/legacy-vs-whatwg-url-serialize.js b/benchmark/url/legacy-vs-whatwg-url-serialize.js
index e3254ede3a..b36cde12b7 100644
--- a/benchmark/url/legacy-vs-whatwg-url-serialize.js
+++ b/benchmark/url/legacy-vs-whatwg-url-serialize.js
@@ -7,7 +7,7 @@ const assert = require('assert');
const bench = common.createBenchmark(main, {
type: common.urlDataTypes,
method: ['legacy', 'whatwg'],
- e: [1]
+ e: [1],
});
function useLegacy(data) {
diff --git a/benchmark/url/url-format.js b/benchmark/url/url-format.js
index be5632d2b6..d5cda90f72 100644
--- a/benchmark/url/url-format.js
+++ b/benchmark/url/url-format.js
@@ -9,7 +9,7 @@ const inputs = {
const bench = common.createBenchmark(main, {
type: Object.keys(inputs),
- n: [25e6]
+ n: [25e6],
});
function main({ type, n }) {
diff --git a/benchmark/url/url-parse.js b/benchmark/url/url-parse.js
index b3e83188b2..163dd790f8 100644
--- a/benchmark/url/url-parse.js
+++ b/benchmark/url/url-parse.js
@@ -4,12 +4,12 @@ const url = require('url');
const inputs = {
normal: 'http://foo.com/bar',
- escaped: 'https://foo.bar/{}^`/abcd'
+ escaped: 'https://foo.bar/{}^`/abcd',
};
const bench = common.createBenchmark(main, {
type: Object.keys(inputs),
- n: [1e7]
+ n: [1e7],
});
function main({ type, n }) {
diff --git a/benchmark/url/url-resolve.js b/benchmark/url/url-resolve.js
index 9f6e958a00..9f33dea70e 100644
--- a/benchmark/url/url-resolve.js
+++ b/benchmark/url/url-resolve.js
@@ -9,13 +9,13 @@ const paths = {
'sibling': '../foo/bar?baz=boom',
'foo/bar': 'foo/bar',
'withscheme': 'http://nodejs.org',
- 'down': './foo/bar?baz'
+ 'down': './foo/bar?baz',
};
const bench = common.createBenchmark(main, {
href: Object.keys(hrefs),
path: Object.keys(paths),
- n: [1e5]
+ n: [1e5],
});
function main({ n, href, path }) {
diff --git a/benchmark/url/url-searchparams-iteration.js b/benchmark/url/url-searchparams-iteration.js
index ce530c5227..89f78fb168 100644
--- a/benchmark/url/url-searchparams-iteration.js
+++ b/benchmark/url/url-searchparams-iteration.js
@@ -4,7 +4,7 @@ const assert = require('assert');
const bench = common.createBenchmark(main, {
loopMethod: ['forEach', 'iterator'],
- n: [1e6]
+ n: [1e6],
});
const str = 'one=single&two=first&three=first&two=2nd&three=2nd&three=3rd';
diff --git a/benchmark/url/url-searchparams-read.js b/benchmark/url/url-searchparams-read.js
index e1cb39fbe7..26d3a0223b 100644
--- a/benchmark/url/url-searchparams-read.js
+++ b/benchmark/url/url-searchparams-read.js
@@ -4,7 +4,7 @@ const common = require('../common.js');
const bench = common.createBenchmark(main, {
accessMethod: ['get', 'getAll', 'has'],
param: ['one', 'two', 'three', 'nonexistent'],
- n: [2e7]
+ n: [2e7],
});
const str = 'one=single&two=first&three=first&two=2nd&three=2nd&three=3rd';
diff --git a/benchmark/url/url-searchparams-sort.js b/benchmark/url/url-searchparams-sort.js
index a1873fd612..fcd55cd397 100644
--- a/benchmark/url/url-searchparams-sort.js
+++ b/benchmark/url/url-searchparams-sort.js
@@ -13,7 +13,7 @@ const inputs = {
// 88 parameters
long: 'g&r&t&h&s&r&d&w&b&n&h&k&x&m&k&h&o&e&x&c&c&g&e&b&p&p&s&n&j&b&y&z&' +
'u&l&o&r&w&a&u&l&m&f&j&q&p&f&e&y&e&n&e&l&m&w&u&w&t&n&t&q&v&y&c&o&' +
- 'k&f&j&i&l&m&g&j&d&i&z&q&p&x&q&q&d&n&y&w&g&i&v&r'
+ 'k&f&j&i&l&m&g&j&d&i&z&q&p&x&q&q&d&n&y&w&g&i&v&r',
};
function getParams(str) {
@@ -26,9 +26,9 @@ function getParams(str) {
const bench = common.createBenchmark(main, {
type: Object.keys(inputs),
- n: [1e6]
+ n: [1e6],
}, {
- flags: ['--expose-internals']
+ flags: ['--expose-internals'],
});
function main({ type, n }) {
diff --git a/benchmark/url/usvstring.js b/benchmark/url/usvstring.js
index 37141ff551..93a50846fb 100644
--- a/benchmark/url/usvstring.js
+++ b/benchmark/url/usvstring.js
@@ -7,13 +7,13 @@ const inputs = {
'\ud800\udfff',
someinvalid: 'asasfdfasd\uda23',
allinvalid: '\udc45\uda23 \udf00\udc00 \udfaa\uda12 \udc00\udfaa',
- nonstring: { toString() { return 'asdf'; } }
+ nonstring: { toString() { return 'asdf'; } },
};
const bench = common.createBenchmark(main, {
input: Object.keys(inputs),
- n: [5e7]
+ n: [5e7],
}, {
- flags: ['--expose-internals']
+ flags: ['--expose-internals'],
});
function main({ input, n }) {
diff --git a/benchmark/url/whatwg-url-idna.js b/benchmark/url/whatwg-url-idna.js
index 853a19776d..0f4139fc02 100644
--- a/benchmark/url/whatwg-url-idna.js
+++ b/benchmark/url/whatwg-url-idna.js
@@ -5,30 +5,30 @@ const { domainToASCII, domainToUnicode } = require('url');
const domains = {
empty: {
ascii: '',
- unicode: ''
+ unicode: '',
},
none: {
ascii: 'passports',
- unicode: 'passports'
+ unicode: 'passports',
},
some: {
ascii: 'Paßstraße',
- unicode: 'xn--Pastrae-1vae'
+ unicode: 'xn--Pastrae-1vae',
},
all: {
ascii: '他们不说中文',
- unicode: 'xn--ihqwczyycu19kkg2c'
+ unicode: 'xn--ihqwczyycu19kkg2c',
},
nonstring: {
ascii: { toString() { return ''; } },
- unicode: { toString() { return ''; } }
- }
+ unicode: { toString() { return ''; } },
+ },
};
const bench = common.createBenchmark(main, {
domain: Object.keys(domains),
to: ['ascii', 'unicode'],
- n: [5e6]
+ n: [5e6],
});
function main({ n, to, domain }) {
diff --git a/benchmark/url/whatwg-url-properties.js b/benchmark/url/whatwg-url-properties.js
index f0ba2931e5..0c1bc225ba 100644
--- a/benchmark/url/whatwg-url-properties.js
+++ b/benchmark/url/whatwg-url-properties.js
@@ -7,7 +7,7 @@ const bench = common.createBenchmark(main, {
e: [1],
prop: ['href', 'origin', 'protocol',
'username', 'password', 'host', 'hostname', 'port',
- 'pathname', 'search', 'searchParams', 'hash']
+ 'pathname', 'search', 'searchParams', 'hash'],
});
function setAndGet(data, prop) {