summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2020-11-24 14:11:20 +0100
committerMichaël Zasso <targos@protonmail.com>2020-12-07 20:33:45 +0100
commitbf31d3c3b17ffe97828381dc7caf3f73d21805fd (patch)
tree8bac22a5f87d0a278b8ed62b489b2a3069af2b44 /benchmark
parent0869b829fa6be2934c5a2e7fe8eaeb2e89490a8f (diff)
downloadios-node-v8-bf31d3c3b17ffe97828381dc7caf3f73d21805fd.tar.gz
ios-node-v8-bf31d3c3b17ffe97828381dc7caf3f73d21805fd.tar.bz2
ios-node-v8-bf31d3c3b17ffe97828381dc7caf3f73d21805fd.zip
tools: enable no-unused-expressions lint rule
Fixes: https://github.com/nodejs/node/issues/36246 PR-URL: https://github.com/nodejs/node/pull/36248 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/_benchmark_progress.js1
-rw-r--r--benchmark/es/destructuring-bench.js6
-rw-r--r--benchmark/perf_hooks/bench-eventlooputil.js2
-rw-r--r--benchmark/process/bench-env.js4
-rw-r--r--benchmark/string_decoder/string-decoder-create.js3
5 files changed, 8 insertions, 8 deletions
diff --git a/benchmark/_benchmark_progress.js b/benchmark/_benchmark_progress.js
index 1b7ac738f6..6c925f34e6 100644
--- a/benchmark/_benchmark_progress.js
+++ b/benchmark/_benchmark_progress.js
@@ -39,7 +39,6 @@ class BenchmarkProgress {
this.completedConfig = 0;
// Total number of configurations for the current file
this.scheduledConfig = 0;
- this.interval; // Updates the elapsed time.
}
startQueue(index) {
diff --git a/benchmark/es/destructuring-bench.js b/benchmark/es/destructuring-bench.js
index c07c0383da..d412b82757 100644
--- a/benchmark/es/destructuring-bench.js
+++ b/benchmark/es/destructuring-bench.js
@@ -12,7 +12,8 @@ function runSwapManual(n) {
let x, y, r;
bench.start();
for (let i = 0; i < n; i++) {
- x = 1, y = 2;
+ x = 1;
+ y = 2;
r = x;
x = y;
y = r;
@@ -26,7 +27,8 @@ function runSwapDestructured(n) {
let x, y;
bench.start();
for (let i = 0; i < n; i++) {
- x = 1, y = 2;
+ x = 1;
+ y = 2;
[x, y] = [y, x];
assert.strictEqual(x, 2);
assert.strictEqual(y, 1);
diff --git a/benchmark/perf_hooks/bench-eventlooputil.js b/benchmark/perf_hooks/bench-eventlooputil.js
index 984b2b66ae..1fd452afa9 100644
--- a/benchmark/perf_hooks/bench-eventlooputil.js
+++ b/benchmark/perf_hooks/bench-eventlooputil.js
@@ -33,7 +33,7 @@ function main({ method, n }) {
function benchIdleTime(n) {
bench.start();
for (let i = 0; i < n; i++)
- nodeTiming.idleTime;
+ nodeTiming.idleTime; // eslint-disable-line no-unused-expressions
bench.end(n);
}
diff --git a/benchmark/process/bench-env.js b/benchmark/process/bench-env.js
index 5df521cc95..e96c1d0250 100644
--- a/benchmark/process/bench-env.js
+++ b/benchmark/process/bench-env.js
@@ -13,7 +13,7 @@ function main({ n, operation }) {
case 'get':
bench.start();
for (let i = 0; i < n; i++) {
- process.env.PATH;
+ process.env.PATH; // eslint-disable-line no-unused-expressions
}
bench.end(n);
break;
@@ -42,7 +42,7 @@ function main({ n, operation }) {
case 'query':
bench.start();
for (let i = 0; i < n; i++) {
- 'PATH' in process.env;
+ 'PATH' in process.env; // eslint-disable-line no-unused-expressions
}
bench.end(n);
break;
diff --git a/benchmark/string_decoder/string-decoder-create.js b/benchmark/string_decoder/string-decoder-create.js
index f7fa5e0246..641e562fde 100644
--- a/benchmark/string_decoder/string-decoder-create.js
+++ b/benchmark/string_decoder/string-decoder-create.js
@@ -12,8 +12,7 @@ const bench = common.createBenchmark(main, {
function main({ encoding, n }) {
bench.start();
for (let i = 0; i < n; ++i) {
- const sd = new StringDecoder(encoding);
- !!sd.encoding;
+ new StringDecoder(encoding);
}
bench.end(n);
}