Skip to content

Commit

Permalink
benchmark: remove unused catch bindings
Browse files Browse the repository at this point in the history
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
  • Loading branch information
cjihrig authored and targos committed Nov 6, 2018
1 parent a35bcd5 commit 40b3ad3
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions benchmark/_http-benchmarkers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -106,7 +106,7 @@ class TestDoubleBenchmarker {
let result;
try {
result = JSON.parse(output);
} catch (err) {
} catch {
return undefined;
}
return result.throughput;
Expand Down
2 changes: 1 addition & 1 deletion benchmark/child_process/child-process-exec-stdout.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions benchmark/fs/read-stream-throughput.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
});
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions benchmark/fs/readfile-partitioned.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions benchmark/fs/readfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions benchmark/fs/write-stream-throughput.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
});

Expand Down
2 changes: 1 addition & 1 deletion benchmark/misc/punycode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/module/module-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions benchmark/napi/function_args/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions benchmark/napi/function_call/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down

0 comments on commit 40b3ad3

Please sign in to comment.