summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/_benchmark_progress.js18
-rw-r--r--benchmark/_http-benchmarkers.js20
-rw-r--r--benchmark/assert/deepequal-typedarrays.js13
-rw-r--r--benchmark/buffers/buffer-base64-decode-wrapped.js2
-rw-r--r--benchmark/buffers/buffer-bytelength.js8
-rw-r--r--benchmark/buffers/buffer-read.js12
-rw-r--r--benchmark/buffers/buffer-swap.js10
-rw-r--r--benchmark/buffers/buffer-write.js22
-rw-r--r--benchmark/buffers/dataview-set.js2
-rw-r--r--benchmark/common.js4
-rw-r--r--benchmark/compare.js6
-rw-r--r--benchmark/crypto/cipher-stream.js2
-rw-r--r--benchmark/crypto/hash-stream-creation.js2
-rw-r--r--benchmark/crypto/hash-stream-throughput.js2
-rw-r--r--benchmark/crypto/rsa-encrypt-decrypt-throughput.js8
-rw-r--r--benchmark/crypto/rsa-sign-verify-throughput.js8
-rw-r--r--benchmark/es/map-bench.js66
-rw-r--r--benchmark/fs/bench-realpath.js2
-rw-r--r--benchmark/fs/bench-realpathSync.js2
-rw-r--r--benchmark/http/_chunky_http_client.js2
-rw-r--r--benchmark/http/cluster.js2
-rw-r--r--benchmark/http/http_server_for_chunky_client.js4
-rw-r--r--benchmark/http/simple.js3
-rw-r--r--benchmark/misc/console.js8
-rw-r--r--benchmark/misc/v8-bench.js8
-rw-r--r--benchmark/module/module-loader.js14
-rw-r--r--benchmark/net/net-c2s-cork.js2
-rw-r--r--benchmark/net/net-c2s.js2
-rw-r--r--benchmark/net/net-pipe.js2
-rw-r--r--benchmark/net/net-s2c.js2
-rw-r--r--benchmark/net/tcp-raw-c2s.js2
-rw-r--r--benchmark/net/tcp-raw-pipe.js2
-rw-r--r--benchmark/net/tcp-raw-s2c.js2
-rw-r--r--benchmark/path/basename-posix.js2
-rw-r--r--benchmark/path/basename-win32.js2
-rw-r--r--benchmark/path/dirname-posix.js2
-rw-r--r--benchmark/path/dirname-win32.js2
-rw-r--r--benchmark/path/extname-posix.js2
-rw-r--r--benchmark/path/extname-win32.js2
-rw-r--r--benchmark/path/format-posix.js2
-rw-r--r--benchmark/path/format-win32.js2
-rw-r--r--benchmark/path/isAbsolute-posix.js2
-rw-r--r--benchmark/path/isAbsolute-win32.js2
-rw-r--r--benchmark/path/join-posix.js2
-rw-r--r--benchmark/path/join-win32.js2
-rw-r--r--benchmark/path/makeLong-win32.js2
-rw-r--r--benchmark/path/normalize-posix.js2
-rw-r--r--benchmark/path/normalize-win32.js2
-rw-r--r--benchmark/path/parse-posix.js2
-rw-r--r--benchmark/path/parse-win32.js2
-rw-r--r--benchmark/path/relative-posix.js2
-rw-r--r--benchmark/path/relative-win32.js2
-rw-r--r--benchmark/path/resolve-posix.js2
-rw-r--r--benchmark/path/resolve-win32.js2
-rw-r--r--benchmark/run.js2
-rw-r--r--benchmark/scatter.js2
-rw-r--r--benchmark/timers/timers-cancel-unpooled.js2
-rw-r--r--benchmark/timers/timers-insert-unpooled.js2
-rw-r--r--benchmark/tls/throughput.js6
-rw-r--r--benchmark/tls/tls-connect.js6
-rw-r--r--benchmark/url/legacy-vs-whatwg-url-get-prop.js4
61 files changed, 168 insertions, 162 deletions
diff --git a/benchmark/_benchmark_progress.js b/benchmark/_benchmark_progress.js
index 4afae2f77d..5e2ae4ab11 100644
--- a/benchmark/_benchmark_progress.js
+++ b/benchmark/_benchmark_progress.js
@@ -3,12 +3,13 @@
const readline = require('readline');
function pad(input, minLength, fill) {
- var result = input + '';
- return fill.repeat(Math.max(0, minLength - result.length)) + result;
+ var result = String(input);
+ var padding = fill.repeat(Math.max(0, minLength - result.length));
+ return `${padding}${result}`;
}
function fraction(numerator, denominator) {
- const fdenominator = denominator + '';
+ const fdenominator = String(denominator);
const fnumerator = pad(numerator, fdenominator.length, ' ');
return `${fnumerator}/${fdenominator}`;
}
@@ -100,11 +101,12 @@ class BenchmarkProgress {
const percent = pad(Math.floor(completedRate * 100), 3, ' ');
const caption = finished ? 'Done\n' : this.currentFile;
- return `[${getTime(diff)}|% ${percent}` +
- `| ${fraction(completedFiles, scheduledFiles)} files ` +
- `| ${fraction(completedRunsForFile, runsPerFile)} runs ` +
- `| ${fraction(completedConfig, scheduledConfig)} configs]` +
- `: ${caption} `;
+ return `[${getTime(diff)}|% ${
+ percent}| ${
+ fraction(completedFiles, scheduledFiles)} files | ${
+ fraction(completedRunsForFile, runsPerFile)} runs | ${
+ fraction(completedConfig, scheduledConfig)} configs]: ${
+ caption} `;
}
updateProgress(finished) {
diff --git a/benchmark/_http-benchmarkers.js b/benchmark/_http-benchmarkers.js
index 78e4248bfa..4ad4ab9994 100644
--- a/benchmark/_http-benchmarkers.js
+++ b/benchmark/_http-benchmarkers.js
@@ -4,6 +4,9 @@ const child_process = require('child_process');
const path = require('path');
const fs = require('fs');
+const requirementsURL =
+ 'https://github.com/nodejs/node/blob/master/doc/guides/writing-and-running-benchmarks.md##http-benchmark-requirements';
+
// The port used by servers and wrk
exports.PORT = process.env.PORT || 12346;
@@ -133,20 +136,19 @@ exports.run = function(options, callback) {
benchmarker: exports.default_http_benchmarker
}, options);
if (!options.benchmarker) {
- callback(new Error('Could not locate required http benchmarker. See ' +
- 'https://github.com/nodejs/node/blob/master/doc/guides/writing-and-running-benchmarks.md##http-benchmark-requirements ' +
- 'for further instructions.'));
+ callback(new Error(`Could not locate required http benchmarker. See ${
+ requirementsURL} for further instructions.`));
return;
}
const benchmarker = benchmarkers[options.benchmarker];
if (!benchmarker) {
- callback(new Error(`Requested benchmarker '${options.benchmarker}' is ` +
- 'not supported'));
+ callback(new Error(`Requested benchmarker '${
+ options.benchmarker}' is not supported`));
return;
}
if (!benchmarker.present) {
- callback(new Error(`Requested benchmarker '${options.benchmarker}' is ` +
- 'not installed'));
+ callback(new Error(`Requested benchmarker '${
+ options.benchmarker}' is not installed`));
return;
}
@@ -172,8 +174,8 @@ exports.run = function(options, callback) {
const result = benchmarker.processResults(stdout);
if (result === undefined) {
- callback(new Error(`${options.benchmarker} produced strange output: ` +
- stdout, code));
+ callback(new Error(
+ `${options.benchmarker} produced strange output: ${stdout}`, code));
return;
}
diff --git a/benchmark/assert/deepequal-typedarrays.js b/benchmark/assert/deepequal-typedarrays.js
index 037cfb2cf1..00c6ca5adf 100644
--- a/benchmark/assert/deepequal-typedarrays.js
+++ b/benchmark/assert/deepequal-typedarrays.js
@@ -2,8 +2,17 @@
const common = require('../common.js');
const assert = require('assert');
const bench = common.createBenchmark(main, {
- type: ('Int8Array Uint8Array Int16Array Uint16Array Int32Array Uint32Array ' +
- 'Float32Array Float64Array Uint8ClampedArray').split(' '),
+ type: [
+ 'Int8Array',
+ 'Uint8Array',
+ 'Int16Array',
+ 'Uint16Array',
+ 'Int32Array',
+ 'Uint32Array',
+ 'Float32Array',
+ 'Float64Array',
+ 'Uint8ClampedArray',
+ ],
n: [1],
method: ['strict', 'nonstrict'],
len: [1e6]
diff --git a/benchmark/buffers/buffer-base64-decode-wrapped.js b/benchmark/buffers/buffer-base64-decode-wrapped.js
index aa070ab55c..3140cd5525 100644
--- a/benchmark/buffers/buffer-base64-decode-wrapped.js
+++ b/benchmark/buffers/buffer-base64-decode-wrapped.js
@@ -12,7 +12,7 @@ function main(conf) {
const linesCount = 8 << 16;
const bytesCount = charsPerLine * linesCount / 4 * 3;
- const line = 'abcd'.repeat(charsPerLine / 4) + '\n';
+ const line = `${'abcd'.repeat(charsPerLine / 4)}\n`;
const data = line.repeat(linesCount);
// eslint-disable-next-line no-unescaped-regexp-dot
data.match(/./); // Flatten the string
diff --git a/benchmark/buffers/buffer-bytelength.js b/benchmark/buffers/buffer-bytelength.js
index f24bc5bc29..44b0f9e389 100644
--- a/benchmark/buffers/buffer-bytelength.js
+++ b/benchmark/buffers/buffer-bytelength.js
@@ -28,7 +28,7 @@ function main(conf) {
} else {
for (var string of chars) {
// Strings must be built differently, depending on encoding
- var data = buildString(string, len);
+ var data = string.repeat(len);
if (encoding === 'utf8') {
strings.push(data);
} else if (encoding === 'base64') {
@@ -54,9 +54,3 @@ function main(conf) {
}
bench.end(n);
}
-
-function buildString(str, times) {
- if (times === 1) return str;
-
- return str + buildString(str, times - 1);
-}
diff --git a/benchmark/buffers/buffer-read.js b/benchmark/buffers/buffer-read.js
index d23bd029f8..30f3ff05ad 100644
--- a/benchmark/buffers/buffer-read.js
+++ b/benchmark/buffers/buffer-read.js
@@ -30,14 +30,14 @@ function main(conf) {
var len = +conf.millions * 1e6;
var clazz = conf.buf === 'fast' ? Buffer : require('buffer').SlowBuffer;
var buff = new clazz(8);
- var fn = 'read' + conf.type;
+ var fn = `read${conf.type}`;
buff.writeDoubleLE(0, 0, noAssert);
- var testFunction = new Function('buff', [
- 'for (var i = 0; i !== ' + len + '; i++) {',
- ' buff.' + fn + '(0, ' + JSON.stringify(noAssert) + ');',
- '}'
- ].join('\n'));
+ var testFunction = new Function('buff', `
+ for (var i = 0; i !== ${len}; i++) {
+ buff.${fn}(0, ${JSON.stringify(noAssert)});
+ }
+ `);
bench.start();
testFunction(buff);
bench.end(len / 1e6);
diff --git a/benchmark/buffers/buffer-swap.js b/benchmark/buffers/buffer-swap.js
index 71e0889091..9e36985f5c 100644
--- a/benchmark/buffers/buffer-swap.js
+++ b/benchmark/buffers/buffer-swap.js
@@ -64,11 +64,11 @@ function createBuffer(len, aligned) {
}
function genMethod(method) {
- const fnString =
- 'return function ' + method + '(n, buf) {' +
- ' for (var i = 0; i <= n; i++)' +
- ' buf.' + method + '();' +
- '}';
+ const fnString = `
+ return function ${method}(n, buf) {
+ for (var i = 0; i <= n; i++)
+ buf.${method}();
+ }`;
return (new Function(fnString))();
}
diff --git a/benchmark/buffers/buffer-write.js b/benchmark/buffers/buffer-write.js
index 32c7330453..758c8b8b51 100644
--- a/benchmark/buffers/buffer-write.js
+++ b/benchmark/buffers/buffer-write.js
@@ -50,7 +50,7 @@ function main(conf) {
var len = +conf.millions * 1e6;
var clazz = conf.buf === 'fast' ? Buffer : require('buffer').SlowBuffer;
var buff = new clazz(8);
- var fn = 'write' + conf.type;
+ var fn = `write${conf.type}`;
if (fn.match(/Int/))
benchInt(buff, fn, len, noAssert);
@@ -60,22 +60,22 @@ function main(conf) {
function benchInt(buff, fn, len, noAssert) {
var m = mod[fn];
- var testFunction = new Function('buff', [
- 'for (var i = 0; i !== ' + len + '; i++) {',
- ' buff.' + fn + '(i & ' + m + ', 0, ' + JSON.stringify(noAssert) + ');',
- '}'
- ].join('\n'));
+ var testFunction = new Function('buff', `
+ for (var i = 0; i !== ${len}; i++) {
+ buff.${fn}(i & ${m}, 0, ${JSON.stringify(noAssert)});
+ }
+ `);
bench.start();
testFunction(buff);
bench.end(len / 1e6);
}
function benchFloat(buff, fn, len, noAssert) {
- var testFunction = new Function('buff', [
- 'for (var i = 0; i !== ' + len + '; i++) {',
- ' buff.' + fn + '(i, 0, ' + JSON.stringify(noAssert) + ');',
- '}'
- ].join('\n'));
+ var testFunction = new Function('buff', `
+ for (var i = 0; i !== ${len}; i++) {
+ buff.${fn}(i, 0, ${JSON.stringify(noAssert)});
+ }
+ `);
bench.start();
testFunction(buff);
bench.end(len / 1e6);
diff --git a/benchmark/buffers/dataview-set.js b/benchmark/buffers/dataview-set.js
index 717a77de71..16b2628842 100644
--- a/benchmark/buffers/dataview-set.js
+++ b/benchmark/buffers/dataview-set.js
@@ -44,7 +44,7 @@ function main(conf) {
var ab = new ArrayBuffer(8);
var dv = new DataView(ab, 0, 8);
var le = /LE$/.test(conf.type);
- var fn = 'set' + conf.type.replace(/[LB]E$/, '');
+ var fn = `set${conf.type.replace(/[LB]E$/, '')}`;
if (/int/i.test(fn))
benchInt(dv, fn, len, le);
diff --git a/benchmark/common.js b/benchmark/common.js
index 50c8e21244..fc47a3ce02 100644
--- a/benchmark/common.js
+++ b/benchmark/common.js
@@ -44,7 +44,7 @@ Benchmark.prototype._parseArgs = function(argv, configs) {
for (const arg of argv) {
const match = arg.match(/^(.+?)=([\s\S]*)$/);
if (!match) {
- console.error('bad argument: ' + arg);
+ console.error(`bad argument: ${arg}`);
process.exit(1);
}
const config = match[1];
@@ -206,7 +206,7 @@ function formatResult(data) {
// Construct configuration string, " A=a, B=b, ..."
let conf = '';
for (const key of Object.keys(data.conf)) {
- conf += ' ' + key + '=' + JSON.stringify(data.conf[key]);
+ conf += ` ${key}=${JSON.stringify(data.conf[key])}`;
}
var rate = data.rate.toString().split('.');
diff --git a/benchmark/compare.js b/benchmark/compare.js
index 4d183a10e2..aa6ddb72c0 100644
--- a/benchmark/compare.js
+++ b/benchmark/compare.js
@@ -79,14 +79,14 @@ if (showProgress) {
// Construct configuration string, " A=a, B=b, ..."
let conf = '';
for (const key of Object.keys(data.conf)) {
- conf += ' ' + key + '=' + JSON.stringify(data.conf[key]);
+ conf += ` ${key}=${JSON.stringify(data.conf[key])}`;
}
conf = conf.slice(1);
// Escape quotes (") for correct csv formatting
conf = conf.replace(/"/g, '""');
- console.log(`"${job.binary}", "${job.filename}", "${conf}", ` +
- `${data.rate}, ${data.time}`);
+ console.log(`"${job.binary}", "${job.filename}", "${conf}", ${
+ data.rate}, ${data.time}`);
if (showProgress) {
// One item in the subqueue has been completed.
progress.completeConfig(data);
diff --git a/benchmark/crypto/cipher-stream.js b/benchmark/crypto/cipher-stream.js
index 03780ba130..90bf548c76 100644
--- a/benchmark/crypto/cipher-stream.js
+++ b/benchmark/crypto/cipher-stream.js
@@ -51,7 +51,7 @@ function main(conf) {
message = Buffer.alloc(conf.len, 'b');
break;
default:
- throw new Error('unknown message type: ' + conf.type);
+ throw new Error(`unknown message type: ${conf.type}`);
}
var fn = api === 'stream' ? streamWrite : legacyWrite;
diff --git a/benchmark/crypto/hash-stream-creation.js b/benchmark/crypto/hash-stream-creation.js
index 3be09785ac..296127ab38 100644
--- a/benchmark/crypto/hash-stream-creation.js
+++ b/benchmark/crypto/hash-stream-creation.js
@@ -36,7 +36,7 @@ function main(conf) {
message = Buffer.alloc(conf.len, 'b');
break;
default:
- throw new Error('unknown message type: ' + conf.type);
+ throw new Error(`unknown message type: ${conf.type}`);
}
var fn = api === 'stream' ? streamWrite : legacyWrite;
diff --git a/benchmark/crypto/hash-stream-throughput.js b/benchmark/crypto/hash-stream-throughput.js
index bf426fc2c9..dbb2e5c999 100644
--- a/benchmark/crypto/hash-stream-throughput.js
+++ b/benchmark/crypto/hash-stream-throughput.js
@@ -35,7 +35,7 @@ function main(conf) {
message = Buffer.alloc(conf.len, 'b');
break;
default:
- throw new Error('unknown message type: ' + conf.type);
+ throw new Error(`unknown message type: ${conf.type}`);
}
var fn = api === 'stream' ? streamWrite : legacyWrite;
diff --git a/benchmark/crypto/rsa-encrypt-decrypt-throughput.js b/benchmark/crypto/rsa-encrypt-decrypt-throughput.js
index 4d98f9e2d5..b1fc339366 100644
--- a/benchmark/crypto/rsa-encrypt-decrypt-throughput.js
+++ b/benchmark/crypto/rsa-encrypt-decrypt-throughput.js
@@ -10,10 +10,10 @@ var RSA_PublicPem = {};
var RSA_PrivatePem = {};
keylen_list.forEach(function(key) {
- RSA_PublicPem[key] = fs.readFileSync(fixtures_keydir +
- '/rsa_public_' + key + '.pem');
- RSA_PrivatePem[key] = fs.readFileSync(fixtures_keydir +
- '/rsa_private_' + key + '.pem');
+ RSA_PublicPem[key] =
+ fs.readFileSync(`${fixtures_keydir}/rsa_public_${key}.pem`);
+ RSA_PrivatePem[key] =
+ fs.readFileSync(`${fixtures_keydir}/rsa_private_${key}.pem`);
});
var bench = common.createBenchmark(main, {
diff --git a/benchmark/crypto/rsa-sign-verify-throughput.js b/benchmark/crypto/rsa-sign-verify-throughput.js
index c5db94687a..f13dc2585a 100644
--- a/benchmark/crypto/rsa-sign-verify-throughput.js
+++ b/benchmark/crypto/rsa-sign-verify-throughput.js
@@ -10,10 +10,10 @@ var RSA_PublicPem = {};
var RSA_PrivatePem = {};
keylen_list.forEach(function(key) {
- RSA_PublicPem[key] = fs.readFileSync(fixtures_keydir +
- '/rsa_public_' + key + '.pem');
- RSA_PrivatePem[key] = fs.readFileSync(fixtures_keydir +
- '/rsa_private_' + key + '.pem');
+ RSA_PublicPem[key] =
+ fs.readFileSync(`${fixtures_keydir}/rsa_public_${key}.pem`);
+ RSA_PrivatePem[key] =
+ fs.readFileSync(`${fixtures_keydir}/rsa_private_${key}.pem`);
});
var bench = common.createBenchmark(main, {
diff --git a/benchmark/es/map-bench.js b/benchmark/es/map-bench.js
index 4663d71bdd..62ff332fd4 100644
--- a/benchmark/es/map-bench.js
+++ b/benchmark/es/map-bench.js
@@ -16,11 +16,11 @@ function runObject(n) {
var i = 0;
bench.start();
for (; i < n; i++) {
- m['i' + i] = i;
- m['s' + i] = String(i);
- assert.strictEqual(String(m['i' + i]), m['s' + i]);
- m['i' + i] = undefined;
- m['s' + i] = undefined;
+ m[`i${i}`] = i;
+ m[`s${i}`] = String(i);
+ assert.strictEqual(String(m[`i${i}`]), m[`s${i}`]);
+ m[`i${i}`] = undefined;
+ m[`s${i}`] = undefined;
}
bench.end(n / 1e6);
}
@@ -30,11 +30,11 @@ function runNullProtoObject(n) {
var i = 0;
bench.start();
for (; i < n; i++) {
- m['i' + i] = i;
- m['s' + i] = String(i);
- assert.strictEqual(String(m['i' + i]), m['s' + i]);
- m['i' + i] = undefined;
- m['s' + i] = undefined;
+ m[`i${i}`] = i;
+ m[`s${i}`] = String(i);
+ assert.strictEqual(String(m[`i${i}`]), m[`s${i}`]);
+ m[`i${i}`] = undefined;
+ m[`s${i}`] = undefined;
}
bench.end(n / 1e6);
}
@@ -44,11 +44,11 @@ function runNullProtoLiteralObject(n) {
var i = 0;
bench.start();
for (; i < n; i++) {
- m['i' + i] = i;
- m['s' + i] = String(i);
- assert.strictEqual(String(m['i' + i]), m['s' + i]);
- m['i' + i] = undefined;
- m['s' + i] = undefined;
+ m[`i${i}`] = i;
+ m[`s${i}`] = String(i);
+ assert.strictEqual(String(m[`i${i}`]), m[`s${i}`]);
+ m[`i${i}`] = undefined;
+ m[`s${i}`] = undefined;
}
bench.end(n / 1e6);
}
@@ -61,11 +61,11 @@ function runStorageObject(n) {
var i = 0;
bench.start();
for (; i < n; i++) {
- m['i' + i] = i;
- m['s' + i] = String(i);
- assert.strictEqual(String(m['i' + i]), m['s' + i]);
- m['i' + i] = undefined;
- m['s' + i] = undefined;
+ m[`i${i}`] = i;
+ m[`s${i}`] = String(i);
+ assert.strictEqual(String(m[`i${i}`]), m[`s${i}`]);
+ m[`i${i}`] = undefined;
+ m[`s${i}`] = undefined;
}
bench.end(n / 1e6);
}
@@ -73,10 +73,10 @@ function runStorageObject(n) {
function fakeMap() {
const m = {};
return {
- get(key) { return m['$' + key]; },
- set(key, val) { m['$' + key] = val; },
+ get(key) { return m[`$${key}`]; },
+ set(key, val) { m[`$${key}`] = val; },
get size() { return Object.keys(m).length; },
- has(key) { return Object.prototype.hasOwnProperty.call(m, '$' + key); }
+ has(key) { return Object.prototype.hasOwnProperty.call(m, `$${key}`); }
};
}
@@ -85,11 +85,11 @@ function runFakeMap(n) {
var i = 0;
bench.start();
for (; i < n; i++) {
- m.set('i' + i, i);
- m.set('s' + i, String(i));
- assert.strictEqual(String(m.get('i' + i)), m.get('s' + i));
- m.set('i' + i, undefined);
- m.set('s' + i, undefined);
+ m.set(`i${i}`, i);
+ m.set(`s${i}`, String(i));
+ assert.strictEqual(String(m.get(`i${i}`)), m.get(`s${i}`));
+ m.set(`i${i}`, undefined);
+ m.set(`s${i}`, undefined);
}
bench.end(n / 1e6);
}
@@ -99,11 +99,11 @@ function runMap(n) {
var i = 0;
bench.start();
for (; i < n; i++) {
- m.set('i' + i, i);
- m.set('s' + i, String(i));
- assert.strictEqual(String(m.get('i' + i)), m.get('s' + i));
- m.set('i' + i, undefined);
- m.set('s' + i, undefined);
+ m.set(`i${i}`, i);
+ m.set(`s${i}`, String(i));
+ assert.strictEqual(String(m.get(`i${i}`)), m.get(`s${i}`));
+ m.set(`i${i}`, undefined);
+ m.set(`s${i}`, undefined);
}
bench.end(n / 1e6);
}
diff --git a/benchmark/fs/bench-realpath.js b/benchmark/fs/bench-realpath.js
index 384276eaff..d6818d45a5 100644
--- a/benchmark/fs/bench-realpath.js
+++ b/benchmark/fs/bench-realpath.js
@@ -22,7 +22,7 @@ function main(conf) {
else if (type === 'resolved')
resolvedPath(n);
else
- throw new Error('unknown "type": ' + type);
+ throw new Error(`unknown "type": ${type}`);
}
function relativePath(n) {
diff --git a/benchmark/fs/bench-realpathSync.js b/benchmark/fs/bench-realpathSync.js
index bf1a38a746..27a66631ab 100644
--- a/benchmark/fs/bench-realpathSync.js
+++ b/benchmark/fs/bench-realpathSync.js
@@ -24,7 +24,7 @@ function main(conf) {
else if (type === 'resolved')
resolvedPath(n);
else
- throw new Error('unknown "type": ' + type);
+ throw new Error(`unknown "type": ${type}`);
bench.end(n);
}
diff --git a/benchmark/http/_chunky_http_client.js b/benchmark/http/_chunky_http_client.js
index 55f914c6df..d235a5e04a 100644
--- a/benchmark/http/_chunky_http_client.js
+++ b/benchmark/http/_chunky_http_client.js
@@ -37,7 +37,7 @@ function main(conf) {
for (var i = 0; i < extra_header_count; i++) {
// Utilize first three powers of a small integer for an odd cycle and
// because the fourth power of some integers overloads the server.
- todo.push('X-Header-' + i + ': ' + headers[i % 3]);
+ todo.push(`X-Header-${i}: ${headers[i % 3]}`);
}
todo.push('');
todo.push('');
diff --git a/benchmark/http/cluster.js b/benchmark/http/cluster.js
index 464bcfdb63..3a9392c422 100644
--- a/benchmark/http/cluster.js
+++ b/benchmark/http/cluster.js
@@ -27,7 +27,7 @@ function main(conf) {
return;
setTimeout(function() {
- var path = '/' + conf.type + '/' + conf.len;
+ var path = `/${conf.type}/${conf.len}`;
bench.http({
path: path,
diff --git a/benchmark/http/http_server_for_chunky_client.js b/benchmark/http/http_server_for_chunky_client.js
index e58ba5f5a1..bdeb517344 100644
--- a/benchmark/http/http_server_for_chunky_client.js
+++ b/benchmark/http/http_server_for_chunky_client.js
@@ -6,7 +6,7 @@ var fs = require('fs');
var fork = require('child_process').fork;
var common = require('../common.js');
var test = require('../../test/common.js');
-var pep = path.dirname(process.argv[1]) + '/_chunky_http_client.js';
+var pep = `${path.dirname(process.argv[1])}/_chunky_http_client.js`;
var PIPE = test.PIPE;
try {
@@ -30,7 +30,7 @@ server = http.createServer(function(req, res) {
});
server.on('error', function(err) {
- throw new Error('server error: ' + err);
+ throw new Error(`server error: ${err}`);
});
server.listen(PIPE);
diff --git a/benchmark/http/simple.js b/benchmark/http/simple.js
index c773e71791..81b7cb5afb 100644
--- a/benchmark/http/simple.js
+++ b/benchmark/http/simple.js
@@ -16,8 +16,7 @@ function main(conf) {
var server = require('../fixtures/simple-http-server.js')
.listen(process.env.PORT || common.PORT)
.on('listening', function() {
- var path = '/' + conf.type + '/' + conf.len + '/' + conf.chunks + '/' +
- conf.res;
+ var path = `/${conf.type}/${conf.len}/${conf.chunks}/${conf.res}`;
bench.http({
path: path,
diff --git a/benchmark/misc/console.js b/benchmark/misc/console.js
index 9c5aec0eee..9c7c548590 100644
--- a/benchmark/misc/console.js
+++ b/benchmark/misc/console.js
@@ -21,7 +21,7 @@ var bench = common.createBenchmark(main, {
const nullStream = createNullStream();
function usingRestAndConcat(...args) {
- nullStream.write('this is ' + args[0] + ' of ' + args[1] + '\n');
+ nullStream.write(`this is ${args[0]} of ${args[1]}\n`);
}
function usingRestAndSpreadTS(...args) {
@@ -37,15 +37,15 @@ function usingArgumentsAndApplyTS() {
}
function usingRestAndSpreadC(...args) {
- nullStream.write(util.format(...args) + '\n');
+ nullStream.write(`${util.format(...args)}\n`);
}
function usingRestAndApplyC(...args) {
- nullStream.write(util.format.apply(null, args) + '\n');
+ nullStream.write(`${util.format.apply(null, args)}\n`);
}
function usingArgumentsAndApplyC() {
- nullStream.write(util.format.apply(null, arguments) + '\n');
+ nullStream.write(`${util.format.apply(null, arguments)}\n`);
}
function runUsingRestAndConcat(n) {
diff --git a/benchmark/misc/v8-bench.js b/benchmark/misc/v8-bench.js
index 85c64b51fd..97ff0c35c4 100644
--- a/benchmark/misc/v8-bench.js
+++ b/benchmark/misc/v8-bench.js
@@ -9,8 +9,8 @@ var dir = path.join(__dirname, '..', '..', 'deps', 'v8', 'benchmarks');
function load(filename, inGlobal) {
var source = fs.readFileSync(path.join(dir, filename), 'utf8');
- if (!inGlobal) source = '(function () {' + source + '\n})()';
- vm.runInThisContext(source, { filename: 'v8/bechmark/' + filename });
+ if (!inGlobal) source = `(function () {${source}\n})()`;
+ vm.runInThisContext(source, { filename: `v8/bechmark/${filename}` });
}
load('base.js', true);
@@ -41,13 +41,13 @@ global.BenchmarkSuite.RunSuites({
});
},
NotifyError: function(name, error) {
- console.error(name + ': ' + error);
+ console.error(`${name}: ${error}`);
},
NotifyScore: function(score) {
common.sendResult({
name: benchmark_name,
conf: {
- benchmark: 'Score (version ' + global.BenchmarkSuite.version + ')'
+ benchmark: `Score (version ${global.BenchmarkSuite.version})`
},
rate: score,
time: 0
diff --git a/benchmark/module/module-loader.js b/benchmark/module/module-loader.js
index d7e03cfee4..7c72ac1d5c 100644
--- a/benchmark/module/module-loader.js
+++ b/benchmark/module/module-loader.js
@@ -20,13 +20,13 @@ function main(conf) {
try { fs.mkdirSync(benchmarkDirectory); } catch (e) {}
for (var i = 0; i <= n; i++) {
- fs.mkdirSync(benchmarkDirectory + i);
+ fs.mkdirSync(`${benchmarkDirectory}${i}`);
fs.writeFileSync(
- benchmarkDirectory + i + '/package.json',
+ `${benchmarkDirectory}${i}/package.json`,
'{"main": "index.js"}'
);
fs.writeFileSync(
- benchmarkDirectory + i + '/index.js',
+ `${benchmarkDirectory}${i}/index.js`,
'module.exports = "";'
);
}
@@ -43,12 +43,12 @@ function measureFull(n, useCache) {
var i;
if (useCache) {
for (i = 0; i <= n; i++) {
- require(benchmarkDirectory + i + '/index.js');
+ require(`${benchmarkDirectory}${i}/index.js`);
}
}
bench.start();
for (i = 0; i <= n; i++) {
- require(benchmarkDirectory + i + '/index.js');
+ require(`${benchmarkDirectory}${i}/index.js`);
}
bench.end(n / 1e3);
}
@@ -57,12 +57,12 @@ function measureDir(n, useCache) {
var i;
if (useCache) {
for (i = 0; i <= n; i++) {
- require(benchmarkDirectory + i);
+ require(`${benchmarkDirectory}${i}`);
}
}
bench.start();
for (i = 0; i <= n; i++) {
- require(benchmarkDirectory + i);
+ require(`${benchmarkDirectory}${i}`);
}
bench.end(n / 1e3);
}
diff --git a/benchmark/net/net-c2s-cork.js b/benchmark/net/net-c2s-cork.js
index 4a119e9c27..51ad09ae9e 100644
--- a/benchmark/net/net-c2s-cork.js
+++ b/benchmark/net/net-c2s-cork.js
@@ -34,7 +34,7 @@ function main(conf) {
chunk = 'x'.repeat(len);
break;
default:
- throw new Error('invalid type: ' + type);
+ throw new Error(`invalid type: ${type}`);
}
server();
diff --git a/benchmark/net/net-c2s.js b/benchmark/net/net-c2s.js
index fdc5cfc5c7..4bbea92121 100644
--- a/benchmark/net/net-c2s.js
+++ b/benchmark/net/net-c2s.js
@@ -34,7 +34,7 @@ function main(conf) {
chunk = 'x'.repeat(len);
break;
default:
- throw new Error('invalid type: ' + type);
+ throw new Error(`invalid type: ${type}`);
}
server();
diff --git a/benchmark/net/net-pipe.js b/benchmark/net/net-pipe.js
index d40da7e549..507640f8ce 100644
--- a/benchmark/net/net-pipe.js
+++ b/benchmark/net/net-pipe.js
@@ -34,7 +34,7 @@ function main(conf) {
chunk = 'x'.repeat(len);
break;
default:
- throw new Error('invalid type: ' + type);
+ throw new Error(`invalid type: ${type}`);
}
server();
diff --git a/benchmark/net/net-s2c.js b/benchmark/net/net-s2c.js
index 1c104e3417..9148a66f3a 100644
--- a/benchmark/net/net-s2c.js
+++ b/benchmark/net/net-s2c.js
@@ -34,7 +34,7 @@ function main(conf) {
chunk = 'x'.repeat(len);
break;
default:
- throw new Error('invalid type: ' + type);
+ throw new Error(`invalid type: ${type}`);
}
server();
diff --git a/benchmark/net/tcp-raw-c2s.js b/benchmark/net/tcp-raw-c2s.js
index 8c9eff76e9..87c6d5ec7e 100644
--- a/benchmark/net/tcp-raw-c2s.js
+++ b/benchmark/net/tcp-raw-c2s.js
@@ -89,7 +89,7 @@ function client() {
chunk = 'x'.repeat(len);
break;
default:
- throw new Error('invalid type: ' + type);
+ throw new Error(`invalid type: ${type}`);
}
var clientHandle = new TCP();
diff --git a/benchmark/net/tcp-raw-pipe.js b/benchmark/net/tcp-raw-pipe.js
index 77d3553062..c6d319c64d 100644
--- a/benchmark/net/tcp-raw-pipe.js
+++ b/benchmark/net/tcp-raw-pipe.js
@@ -86,7 +86,7 @@ function client() {
chunk = 'x'.repeat(len);
break;
default:
- throw new Error('invalid type: ' + type);
+ throw new Error(`invalid type: ${type}`);
}
var clientHandle = new TCP();
diff --git a/benchmark/net/tcp-raw-s2c.js b/benchmark/net/tcp-raw-s2c.js
index 1cb0fb63f4..1c518a5c7f 100644
--- a/benchmark/net/tcp-raw-s2c.js
+++ b/benchmark/net/tcp-raw-s2c.js
@@ -60,7 +60,7 @@ function server() {
chunk = 'x'.repeat(len);
break;
default:
- throw new Error('invalid type: ' + type);
+ throw new Error(`invalid type: ${type}`);
}
clientHandle.readStart();
diff --git a/benchmark/path/basename-posix.js b/benchmark/path/basename-posix.js
index fc983c8074..10465b2c73 100644
--- a/benchmark/path/basename-posix.js
+++ b/benchmark/path/basename-posix.js
@@ -21,7 +21,7 @@ var bench = common.createBenchmark(main, {
function main(conf) {
var n = +conf.n;
var p = path.posix;
- var input = '' + conf.pathext;
+ var input = String(conf.pathext);
var ext;
var extIdx = input.indexOf('|');
if (extIdx !== -1) {
diff --git a/benchmark/path/basename-win32.js b/benchmark/path/basename-win32.js
index b493beb87c..77bf326ed2 100644
--- a/benchmark/path/basename-win32.js
+++ b/benchmark/path/basename-win32.js
@@ -21,7 +21,7 @@ var bench = common.createBenchmark(main, {
function main(conf) {
var n = +conf.n;
var p = path.win32;
- var input = '' + conf.pathext;
+ var input = String(conf.pathext);
var ext;
var extIdx = input.indexOf('|');
if (extIdx !== -1) {
diff --git a/benchmark/path/dirname-posix.js b/benchmark/path/dirname-posix.js
index af77be5ac0..a72aceb89e 100644
--- a/benchmark/path/dirname-posix.js
+++ b/benchmark/path/dirname-posix.js
@@ -18,7 +18,7 @@ var bench = common.createBenchmark(main, {
function main(conf) {
var n = +conf.n;
var p = path.posix;
- var input = '' + conf.path;
+ var input = String(conf.path);
bench.start();
for (var i = 0; i < n; i++) {
diff --git a/benchmark/path/dirname-win32.js b/benchmark/path/dirname-win32.js
index 01d97d08e2..11a89073e6 100644
--- a/benchmark/path/dirname-win32.js
+++ b/benchmark/path/dirname-win32.js
@@ -18,7 +18,7 @@ var bench = common.createBenchmark(main, {
function main(conf) {
var n = +conf.n;
var p = path.win32;
- var input = '' + conf.path;
+ var input = String(conf.path);
bench.start();
for (var i = 0; i < n; i++) {
diff --git a/benchmark/path/extname-posix.js b/benchmark/path/extname-posix.js
index 50c4e8f792..25d53d08e1 100644
--- a/benchmark/path/extname-posix.js
+++ b/benchmark/path/extname-posix.js
@@ -21,7 +21,7 @@ var bench = common.createBenchmark(main, {
function main(conf) {
var n = +conf.n;
var p = path.posix;
- var input = '' + conf.path;
+ var input = String(conf.path);
bench.start();
for (var i = 0; i < n; i++) {
diff --git a/benchmark/path/extname-win32.js b/benchmark/path/extname-win32.js
index 9c0df13ab4..d4a4638a68 100644
--- a/benchmark/path/extname-win32.js
+++ b/benchmark/path/extname-win32.js
@@ -21,7 +21,7 @@ var bench = common.createBenchmark(main, {
function main(conf) {
var n = +conf.n;
var p = path.win32;
- var input = '' + conf.path;
+ var input = String(conf.path);
bench.start();
for (var i = 0; i < n; i++) {
diff --git a/benchmark/path/format-posix.js b/benchmark/path/format-posix.js
index ee78a6d5f3..04f6207775 100644
--- a/benchmark/path/format-posix.js
+++ b/benchmark/path/format-posix.js
@@ -12,7 +12,7 @@ var bench = common.createBenchmark(main, {
function main(conf) {
var n = +conf.n;
var p = path.posix;
- var props = ('' + conf.props).split('|');
+ var props = String(conf.props).split('|');
var obj = {
root: props[0] || '',
dir: props[1] || '',
diff --git a/benchmark/path/format-win32.js b/benchmark/path/format-win32.js
index 9ec981d631..189fe9c34f 100644
--- a/benchmark/path/format-win32.js
+++ b/benchmark/path/format-win32.js
@@ -12,7 +12,7 @@ var bench = common.createBenchmark(main, {
function main(conf) {
var n = +conf.n;
var p = path.win32;
- var props = ('' + conf.props).split('|');
+ var props = String(conf.props).split('|');
var obj = {
root: props[0] || '',
dir: props[1] || '',
diff --git a/benchmark/path/isAbsolute-posix.js b/benchmark/path/isAbsolute-posix.js
index 22db751100..cff0474654 100644
--- a/benchmark/path/isAbsolute-posix.js
+++ b/benchmark/path/isAbsolute-posix.js
@@ -16,7 +16,7 @@ var bench = common.createBenchmark(main, {
function main(conf) {
var n = +conf.n;
var p = path.posix;
- var input = '' + conf.path;
+ var input = String(conf.path);
bench.start();
for (var i = 0; i < n; i++) {
diff --git a/benchmark/path/isAbsolute-win32.js b/benchmark/path/isAbsolute-win32.js
index a565da8e56..0eeeb64531 100644
--- a/benchmark/path/isAbsolute-win32.js
+++ b/benchmark/path/isAbsolute-win32.js
@@ -17,7 +17,7 @@ var bench = common.createBenchmark(main, {
function main(conf) {
var n = +conf.n;
var p = path.win32;
- var input = '' + conf.path;
+ var input = String(conf.path);
bench.start();
for (var i = 0; i < n; i++) {
diff --git a/benchmark/path/join-posix.js b/benchmark/path/join-posix.js
index a7cf377252..326789bf39 100644
--- a/benchmark/path/join-posix.js
+++ b/benchmark/path/join-posix.js
@@ -12,7 +12,7 @@ var bench = common.createBenchmark(main, {
function main(conf) {
var n = +conf.n;
var p = path.posix;
- var args = ('' + conf.paths).split('|');
+ var args = String(conf.paths).split('|');
bench.start();
for (var i = 0; i < n; i++) {
diff --git a/benchmark/path/join-win32.js b/benchmark/path/join-win32.js
index 18c1e802a6..5042d270e1 100644
--- a/benchmark/path/join-win32.js
+++ b/benchmark/path/join-win32.js
@@ -12,7 +12,7 @@ var bench = common.createBenchmark(main, {
function main(conf) {
var n = +conf.n;
var p = path.win32;
- var args = ('' + conf.paths).split('|');
+ var args = String(conf.paths).split('|');
bench.start();
for (var i = 0; i < n; i++) {
diff --git a/benchmark/path/makeLong-win32.js b/benchmark/path/makeLong-win32.js
index fe5da425a5..0cc6c66204 100644
--- a/benchmark/path/makeLong-win32.js
+++ b/benchmark/path/makeLong-win32.js
@@ -15,7 +15,7 @@ var bench = common.createBenchmark(main, {
function main(conf) {
var n = +conf.n;
var p = path.win32;
- var input = '' + conf.path;
+ var input = String(conf.path);
bench.start();
for (var i = 0; i < n; i++) {
diff --git a/benchmark/path/normalize-posix.js b/benchmark/path/normalize-posix.js
index aec703cbe2..541f7b9112 100644
--- a/benchmark/path/normalize-posix.js
+++ b/benchmark/path/normalize-posix.js
@@ -17,7 +17,7 @@ var bench = common.createBenchmark(main, {
function main(conf) {
var n = +conf.n;
var p = path.posix;
- var input = '' + conf.path;
+ var input = String(conf.path);
bench.start();
for (var i = 0; i < n; i++) {
diff --git a/benchmark/path/normalize-win32.js b/benchmark/path/normalize-win32.js
index 356d399c35..3af2aca434 100644
--- a/benchmark/path/normalize-win32.js
+++ b/benchmark/path/normalize-win32.js
@@ -17,7 +17,7 @@ var bench = common.createBenchmark(main, {
function main(conf) {
var n = +conf.n;
var p = path.win32;
- var input = '' + conf.path;
+ var input = String(conf.path);
bench.start();
for (var i = 0; i < n; i++) {
diff --git a/benchmark/path/parse-posix.js b/benchmark/path/parse-posix.js
index 997eec0452..0130c16aa5 100644
--- a/benchmark/path/parse-posix.js
+++ b/benchmark/path/parse-posix.js
@@ -18,7 +18,7 @@ var bench = common.createBenchmark(main, {
function main(conf) {
var n = +conf.n;
var p = path.posix;
- var input = '' + conf.path;
+ var input = String(conf.path);
for (var i = 0; i < n; i++) {
p.parse(input);
diff --git a/benchmark/path/parse-win32.js b/benchmark/path/parse-win32.js
index 2a95f75866..fbcff5fd68 100644
--- a/benchmark/path/parse-win32.js
+++ b/benchmark/path/parse-win32.js
@@ -19,7 +19,7 @@ var bench = common.createBenchmark(main, {
function main(conf) {
var n = +conf.n;
var p = path.win32;
- var input = '' + conf.path;
+ var input = String(conf.path);
for (var i = 0; i < n; i++) {
p.parse(input);
diff --git a/benchmark/path/relative-posix.js b/benchmark/path/relative-posix.js
index 492b73c3e8..3fb6dc9ee1 100644
--- a/benchmark/path/relative-posix.js
+++ b/benchmark/path/relative-posix.js
@@ -18,7 +18,7 @@ var bench = common.createBenchmark(main, {
function main(conf) {
var n = +conf.n;
var p = path.posix;
- var from = '' + conf.paths;
+ var from = String(conf.paths);
var to = '';
var delimIdx = from.indexOf('|');
if (delimIdx > -1) {
diff --git a/benchmark/path/relative-win32.js b/benchmark/path/relative-win32.js
index 7e7620299e..fafda6d1ce 100644
--- a/benchmark/path/relative-win32.js
+++ b/benchmark/path/relative-win32.js
@@ -16,7 +16,7 @@ var bench = common.createBenchmark(main, {
function main(conf) {
var n = +conf.n;
var p = path.win32;
- var from = '' + conf.paths;
+ var from = String(conf.paths);
var to = '';
var delimIdx = from.indexOf('|');
if (delimIdx > -1) {
diff --git a/benchmark/path/resolve-posix.js b/benchmark/path/resolve-posix.js
index d1364a8ac2..61b809b666 100644
--- a/benchmark/path/resolve-posix.js
+++ b/benchmark/path/resolve-posix.js
@@ -15,7 +15,7 @@ var bench = common.createBenchmark(main, {
function main(conf) {
var n = +conf.n;
var p = path.posix;
- var args = ('' + conf.paths).split('|');
+ var args = String(conf.paths).split('|');
bench.start();
for (var i = 0; i < n; i++) {
diff --git a/benchmark/path/resolve-win32.js b/benchmark/path/resolve-win32.js
index 6dfb38167c..ccfeec696d 100644
--- a/benchmark/path/resolve-win32.js
+++ b/benchmark/path/resolve-win32.js
@@ -15,7 +15,7 @@ var bench = common.createBenchmark(main, {
function main(conf) {
var n = +conf.n;
var p = path.win32;
- var args = ('' + conf.paths).split('|');
+ var args = String(conf.paths).split('|');
bench.start();
for (var i = 0; i < n; i++) {
diff --git a/benchmark/run.js b/benchmark/run.js
index cb4f8cc004..3b4944caf5 100644
--- a/benchmark/run.js
+++ b/benchmark/run.js
@@ -50,7 +50,7 @@ if (format === 'csv') {
// Construct configuration string, " A=a, B=b, ..."
let conf = '';
for (const key of Object.keys(data.conf)) {
- conf += ' ' + key + '=' + JSON.stringify(data.conf[key]);
+ conf += ` ${key}=${JSON.stringify(data.conf[key])}`;
}
// delete first space of the configuration
conf = conf.slice(1);
diff --git a/benchmark/scatter.js b/benchmark/scatter.js
index 65d1a5f604..306d06132f 100644
--- a/benchmark/scatter.js
+++ b/benchmark/scatter.js
@@ -34,7 +34,7 @@ function csvEncodeValue(value) {
if (typeof value === 'number') {
return value.toString();
} else {
- return '"' + value.replace(/"/g, '""') + '"';
+ return `"${value.replace(/"/g, '""')}"`;
}
}
diff --git a/benchmark/timers/timers-cancel-unpooled.js b/benchmark/timers/timers-cancel-unpooled.js
index a040fad69e..14cbad8256 100644
--- a/benchmark/timers/timers-cancel-unpooled.js
+++ b/benchmark/timers/timers-cancel-unpooled.js
@@ -22,5 +22,5 @@ function main(conf) {
}
function cb() {
- assert(false, 'Timer ' + this._idleTimeout + ' should not call callback');
+ assert(false, `Timer ${this._idleTimeout} should not call callback`);
}
diff --git a/benchmark/timers/timers-insert-unpooled.js b/benchmark/timers/timers-insert-unpooled.js
index 91eabeb04e..bdcd7e0ff7 100644
--- a/benchmark/timers/timers-insert-unpooled.js
+++ b/benchmark/timers/timers-insert-unpooled.js
@@ -23,5 +23,5 @@ function main(conf) {
}
function cb() {
- assert(false, 'Timer ' + this._idleTimeout + ' should not call callback');
+ assert(false, `Timer ${this._idleTimeout} should not call callback`);
}
diff --git a/benchmark/tls/throughput.js b/benchmark/tls/throughput.js
index c2b389fe45..2b8b2d5376 100644
--- a/benchmark/tls/throughput.js
+++ b/benchmark/tls/throughput.js
@@ -38,9 +38,9 @@ function main(conf) {
}
options = {
- key: fs.readFileSync(cert_dir + '/test_key.pem'),
- cert: fs.readFileSync(cert_dir + '/test_cert.pem'),
- ca: [ fs.readFileSync(cert_dir + '/test_ca.pem') ],
+ key: fs.readFileSync(`${cert_dir}/test_key.pem`),
+ cert: fs.readFileSync(`${cert_dir}/test_cert.pem`),
+ ca: [ fs.readFileSync(`${cert_dir}/test_ca.pem`) ],
ciphers: 'AES256-GCM-SHA384'
};
diff --git a/benchmark/tls/tls-connect.js b/benchmark/tls/tls-connect.js
index 5ca67f3230..3acc79e73a 100644
--- a/benchmark/tls/tls-connect.js
+++ b/benchmark/tls/tls-connect.js
@@ -22,9 +22,9 @@ function main(conf) {
var cert_dir = path.resolve(__dirname, '../../test/fixtures');
var options = {
- key: fs.readFileSync(cert_dir + '/test_key.pem'),
- cert: fs.readFileSync(cert_dir + '/test_cert.pem'),
- ca: [ fs.readFileSync(cert_dir + '/test_ca.pem') ],
+ key: fs.readFileSync(`${cert_dir}/test_key.pem`),
+ cert: fs.readFileSync(`${cert_dir}/test_cert.pem`),
+ ca: [ fs.readFileSync(`${cert_dir}/test_ca.pem`) ],
ciphers: 'AES256-GCM-SHA384'
};
diff --git a/benchmark/url/legacy-vs-whatwg-url-get-prop.js b/benchmark/url/legacy-vs-whatwg-url-get-prop.js
index ffc8b4995d..733a05a173 100644
--- a/benchmark/url/legacy-vs-whatwg-url-get-prop.js
+++ b/benchmark/url/legacy-vs-whatwg-url-get-prop.js
@@ -48,7 +48,7 @@ function useWHATWG(n, input) {
var obj = new URL(input);
var noDead = {
protocol: obj.protocol,
- auth: obj.username + ':' + obj.password,
+ auth: `${obj.username}:${obj.password}`,
host: obj.host,
hostname: obj.hostname,
port: obj.port,
@@ -59,7 +59,7 @@ function useWHATWG(n, input) {
bench.start();
for (var i = 0; i < n; i += 1) {
noDead.protocol = obj.protocol;
- noDead.auth = obj.username + ':' + obj.password;
+ noDead.auth = `${obj.username}:${obj.password}`;
noDead.host = obj.host;
noDead.hostname = obj.hostname;
noDead.port = obj.port;