summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2018-11-04 12:38:54 -0500
committercjihrig <cjihrig@gmail.com>2018-11-06 10:59:23 -0500
commit5407690bd79a4aa9b5ea72acb98d1a8efd309029 (patch)
tree631bfbf731bdb4fa66338e40a52ecd0579b9d61d /benchmark
parenta74b4a062fd6cf8ba5fb0a17078f855b072841cd (diff)
downloadandroid-node-v8-5407690bd79a4aa9b5ea72acb98d1a8efd309029.tar.gz
android-node-v8-5407690bd79a4aa9b5ea72acb98d1a8efd309029.tar.bz2
android-node-v8-5407690bd79a4aa9b5ea72acb98d1a8efd309029.zip
benchmark: remove unused catch bindings
PR-URL: https://github.com/nodejs/node/pull/24079 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Wyatt Preul <wpreul@gmail.com>
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/_http-benchmarkers.js4
-rw-r--r--benchmark/child_process/child-process-exec-stdout.js2
-rw-r--r--benchmark/fs/read-stream-throughput.js4
-rw-r--r--benchmark/fs/readfile-partitioned.js4
-rw-r--r--benchmark/fs/readfile.js4
-rw-r--r--benchmark/fs/write-stream-throughput.js4
-rw-r--r--benchmark/misc/punycode.js2
-rw-r--r--benchmark/module/module-loader.js2
-rw-r--r--benchmark/napi/function_args/index.js4
-rw-r--r--benchmark/napi/function_call/index.js4
10 files changed, 17 insertions, 17 deletions
diff --git a/benchmark/_http-benchmarkers.js b/benchmark/_http-benchmarkers.js
index baa50f72cd..f66c36ab1d 100644
--- a/benchmark/_http-benchmarkers.js
+++ b/benchmark/_http-benchmarkers.js
@@ -35,7 +35,7 @@ class AutocannonBenchmarker {
let result;
try {
result = JSON.parse(output);
- } catch (err) {
+ } catch {
return undefined;
}
if (!result || !result.requests || !result.requests.average) {
@@ -106,7 +106,7 @@ class TestDoubleBenchmarker {
let result;
try {
result = JSON.parse(output);
- } catch (err) {
+ } catch {
return undefined;
}
return result.throughput;
diff --git a/benchmark/child_process/child-process-exec-stdout.js b/benchmark/child_process/child-process-exec-stdout.js
index a891026b86..88c02533f6 100644
--- a/benchmark/child_process/child-process-exec-stdout.js
+++ b/benchmark/child_process/child-process-exec-stdout.js
@@ -30,7 +30,7 @@ function childProcessExecStdout({ dur, len }) {
// Sometimes there's a yes.exe process left hanging around on Windows.
try {
execSync(`taskkill /f /t /pid ${child.pid}`);
- } catch (_) {
+ } catch {
// this is a best effort kill. stderr is piped to parent for tracing.
}
} else {
diff --git a/benchmark/fs/read-stream-throughput.js b/benchmark/fs/read-stream-throughput.js
index 3af8013272..7f290a310b 100644
--- a/benchmark/fs/read-stream-throughput.js
+++ b/benchmark/fs/read-stream-throughput.js
@@ -55,7 +55,7 @@ function runTest() {
});
rs.on('end', function() {
- try { fs.unlinkSync(filename); } catch (e) {}
+ try { fs.unlinkSync(filename); } catch {}
// MB/sec
bench.end(bytes / (1024 * 1024));
});
@@ -74,7 +74,7 @@ function makeFile() {
buf.fill('x');
}
- try { fs.unlinkSync(filename); } catch (e) {}
+ try { fs.unlinkSync(filename); } catch {}
var w = 1024;
const ws = fs.createWriteStream(filename);
ws.on('close', runTest);
diff --git a/benchmark/fs/readfile-partitioned.js b/benchmark/fs/readfile-partitioned.js
index be3b7fd057..6e355c158d 100644
--- a/benchmark/fs/readfile-partitioned.js
+++ b/benchmark/fs/readfile-partitioned.js
@@ -24,7 +24,7 @@ const bench = common.createBenchmark(main, {
function main(conf) {
const len = +conf.len;
- try { fs.unlinkSync(filename); } catch (e) {}
+ try { fs.unlinkSync(filename); } catch {}
var data = Buffer.alloc(len, 'x');
fs.writeFileSync(filename, data);
data = null;
@@ -39,7 +39,7 @@ function main(conf) {
const totalOps = reads + zips;
benchEnded = true;
bench.end(totalOps);
- try { fs.unlinkSync(filename); } catch (e) {}
+ try { fs.unlinkSync(filename); } catch {}
}, +conf.dur * 1000);
function read() {
diff --git a/benchmark/fs/readfile.js b/benchmark/fs/readfile.js
index 282b4ac762..36439bdf90 100644
--- a/benchmark/fs/readfile.js
+++ b/benchmark/fs/readfile.js
@@ -17,7 +17,7 @@ const bench = common.createBenchmark(main, {
});
function main({ len, dur, concurrent }) {
- try { fs.unlinkSync(filename); } catch (e) {}
+ try { fs.unlinkSync(filename); } catch {}
var data = Buffer.alloc(len, 'x');
fs.writeFileSync(filename, data);
data = null;
@@ -28,7 +28,7 @@ function main({ len, dur, concurrent }) {
setTimeout(function() {
benchEnded = true;
bench.end(reads);
- try { fs.unlinkSync(filename); } catch (e) {}
+ try { fs.unlinkSync(filename); } catch {}
process.exit(0);
}, dur * 1000);
diff --git a/benchmark/fs/write-stream-throughput.js b/benchmark/fs/write-stream-throughput.js
index 60ad47bc4e..baf98f849f 100644
--- a/benchmark/fs/write-stream-throughput.js
+++ b/benchmark/fs/write-stream-throughput.js
@@ -33,7 +33,7 @@ function main({ dur, encodingType, size }) {
throw new Error(`invalid encodingType: ${encodingType}`);
}
- try { fs.unlinkSync(filename); } catch (e) {}
+ try { fs.unlinkSync(filename); } catch {}
var started = false;
var ended = false;
@@ -45,7 +45,7 @@ function main({ dur, encodingType, size }) {
f.on('finish', function() {
ended = true;
const written = fs.statSync(filename).size / 1024;
- try { fs.unlinkSync(filename); } catch (e) {}
+ try { fs.unlinkSync(filename); } catch {}
bench.end(written / 1024);
});
diff --git a/benchmark/misc/punycode.js b/benchmark/misc/punycode.js
index a55660fbc0..c9eef1f709 100644
--- a/benchmark/misc/punycode.js
+++ b/benchmark/misc/punycode.js
@@ -4,7 +4,7 @@ const common = require('../common.js');
let icu;
try {
icu = common.binding('icu');
-} catch (err) {}
+} catch {}
const punycode = require('punycode');
const bench = common.createBenchmark(main, {
diff --git a/benchmark/module/module-loader.js b/benchmark/module/module-loader.js
index c79e1a73d4..e780d6376b 100644
--- a/benchmark/module/module-loader.js
+++ b/benchmark/module/module-loader.js
@@ -14,7 +14,7 @@ const bench = common.createBenchmark(main, {
function main({ n, fullPath, useCache }) {
tmpdir.refresh();
- try { fs.mkdirSync(benchmarkDirectory); } catch (e) {}
+ try { fs.mkdirSync(benchmarkDirectory); } catch {}
for (var i = 0; i <= n; i++) {
fs.mkdirSync(`${benchmarkDirectory}${i}`);
fs.writeFileSync(
diff --git a/benchmark/napi/function_args/index.js b/benchmark/napi/function_args/index.js
index 4beab531c1..c41b5d78ab 100644
--- a/benchmark/napi/function_args/index.js
+++ b/benchmark/napi/function_args/index.js
@@ -11,14 +11,14 @@ let napi;
try {
v8 = require('./build/Release/binding');
-} catch (err) {
+} catch {
console.error(`${__filename}: V8 Binding failed to load`);
process.exit(0);
}
try {
napi = require('./build/Release/napi_binding');
-} catch (err) {
+} catch {
console.error(`${__filename}: NAPI-Binding failed to load`);
process.exit(0);
}
diff --git a/benchmark/napi/function_call/index.js b/benchmark/napi/function_call/index.js
index cbc512c972..272c41662d 100644
--- a/benchmark/napi/function_call/index.js
+++ b/benchmark/napi/function_call/index.js
@@ -13,7 +13,7 @@ const common = require('../../common.js');
try {
var binding = require('./build/Release/binding');
-} catch (er) {
+} catch {
console.error('misc/function_call.js Binding failed to load');
process.exit(0);
}
@@ -22,7 +22,7 @@ const cxx = binding.hello;
let napi_binding;
try {
napi_binding = require('./build/Release/napi_binding');
-} catch (er) {
+} catch {
console.error('misc/function_call/index.js NAPI-Binding failed to load');
process.exit(0);
}