summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2018-11-04 10:25:02 -0500
committercjihrig <cjihrig@gmail.com>2018-11-06 10:59:18 -0500
commita74b4a062fd6cf8ba5fb0a17078f855b072841cd (patch)
tree0e82ccc547e2bcfc366bca14a757a7b37d533e11
parenta7ba5faaf52b3794b1ade619b7f2b9c77517dbd3 (diff)
downloadandroid-node-v8-a74b4a062fd6cf8ba5fb0a17078f855b072841cd.tar.gz
android-node-v8-a74b4a062fd6cf8ba5fb0a17078f855b072841cd.tar.bz2
android-node-v8-a74b4a062fd6cf8ba5fb0a17078f855b072841cd.zip
test: 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>
-rw-r--r--test/common/index.js8
-rw-r--r--test/doctool/test-doctool-html.js2
-rw-r--r--test/doctool/test-doctool-json.js2
-rw-r--r--test/fixtures/catch-stdout-error.js2
-rw-r--r--test/internet/test-dgram-broadcast-multi-process.js2
-rw-r--r--test/internet/test-dgram-multicast-multi-process.js2
-rw-r--r--test/known_issues/test-url-parse-conformance.js4
-rw-r--r--test/message/vm_dont_display_runtime_error.js2
-rw-r--r--test/message/vm_dont_display_syntax_error.js2
-rw-r--r--test/parallel/test-assert.js2
-rw-r--r--test/parallel/test-crypto-cipher-decipher.js12
-rw-r--r--test/parallel/test-file-write-stream2.js2
-rw-r--r--test/parallel/test-fs-realpath-pipe.js2
-rw-r--r--test/parallel/test-fs-realpath.js28
-rw-r--r--test/parallel/test-listen-fd-detached-inherit.js2
-rw-r--r--test/parallel/test-listen-fd-detached.js2
-rw-r--r--test/parallel/test-listen-fd-ebadf.js2
-rw-r--r--test/parallel/test-module-loading-error.js2
-rw-r--r--test/parallel/test-promises-unhandled-rejections.js2
-rw-r--r--test/parallel/test-repl-syntax-error-handling.js2
-rw-r--r--test/parallel/test-require-deps-deprecation.js2
-rw-r--r--test/parallel/test-stdout-close-catch.js2
-rw-r--r--test/parallel/test-stdout-to-file.js2
-rw-r--r--test/parallel/test-vm-low-stack-space.js4
-rw-r--r--test/parallel/test-vm-module-errors.js4
-rw-r--r--test/parallel/test-vm-parse-abort-on-uncaught-exception.js4
-rw-r--r--test/pummel/test-fs-watch-non-recursive.js6
-rw-r--r--test/pummel/test-vm-memleak.js2
-rw-r--r--test/pummel/test-vm-race.js2
-rw-r--r--test/sequential/test-fs-readfile-tostring-fail.js2
30 files changed, 57 insertions, 57 deletions
diff --git a/test/common/index.js b/test/common/index.js
index 768570437a..da5027af13 100644
--- a/test/common/index.js
+++ b/test/common/index.js
@@ -372,7 +372,7 @@ function canCreateSymLink() {
try {
const output = execSync(`${whoamiPath} /priv`, { timout: 1000 });
return output.includes('SeCreateSymbolicLinkPrivilege');
- } catch (e) {
+ } catch {
return false;
}
}
@@ -456,7 +456,7 @@ function isAlive(pid) {
try {
process.kill(pid, 'SIGCONT');
return true;
- } catch (e) {
+ } catch {
return false;
}
}
@@ -665,7 +665,7 @@ function getTTYfd() {
if (ttyFd === undefined) {
try {
return fs.openSync('/dev/tty');
- } catch (e) {
+ } catch {
// There aren't any tty fd's available to use.
return -1;
}
@@ -679,7 +679,7 @@ function runWithInvalidFD(func) {
// be an valid one.
try {
while (fs.fstatSync(fd--) && fd > 0);
- } catch (e) {
+ } catch {
return func(fd);
}
diff --git a/test/doctool/test-doctool-html.js b/test/doctool/test-doctool-html.js
index 78f48ae54e..499034cd8a 100644
--- a/test/doctool/test-doctool-html.js
+++ b/test/doctool/test-doctool-html.js
@@ -4,7 +4,7 @@ const common = require('../common');
// The doctool currently uses js-yaml from the tool/node_modules/eslint/ tree.
try {
require('../../tools/node_modules/eslint/node_modules/js-yaml');
-} catch (e) {
+} catch {
common.skip('missing js-yaml (eslint not present)');
}
diff --git a/test/doctool/test-doctool-json.js b/test/doctool/test-doctool-json.js
index cdd3664cf1..7471a2e1f0 100644
--- a/test/doctool/test-doctool-json.js
+++ b/test/doctool/test-doctool-json.js
@@ -4,7 +4,7 @@ const common = require('../common');
// The doctool currently uses js-yaml from the tool/node_modules/eslint/ tree.
try {
require('../../tools/node_modules/eslint/node_modules/js-yaml');
-} catch (e) {
+} catch {
common.skip('missing js-yaml (eslint not present)');
}
diff --git a/test/fixtures/catch-stdout-error.js b/test/fixtures/catch-stdout-error.js
index bdd09b5ab8..5e30326bf9 100644
--- a/test/fixtures/catch-stdout-error.js
+++ b/test/fixtures/catch-stdout-error.js
@@ -22,7 +22,7 @@
function write() {
try {
process.stdout.write('Hello, world\n');
- } catch (ex) {
+ } catch {
throw new Error('this should never happen');
}
setImmediate(function() {
diff --git a/test/internet/test-dgram-broadcast-multi-process.js b/test/internet/test-dgram-broadcast-multi-process.js
index c30059e739..a8d9786970 100644
--- a/test/internet/test-dgram-broadcast-multi-process.js
+++ b/test/internet/test-dgram-broadcast-multi-process.js
@@ -182,7 +182,7 @@ if (process.argv[2] !== 'child') {
const buf = messages[i++];
if (!buf) {
- try { sendSocket.close(); } catch (e) {}
+ try { sendSocket.close(); } catch {}
return;
}
diff --git a/test/internet/test-dgram-multicast-multi-process.js b/test/internet/test-dgram-multicast-multi-process.js
index e6e7a44fcd..9d2e2c9f3f 100644
--- a/test/internet/test-dgram-multicast-multi-process.js
+++ b/test/internet/test-dgram-multicast-multi-process.js
@@ -170,7 +170,7 @@ if (process.argv[2] !== 'child') {
const buf = messages[i++];
if (!buf) {
- try { sendSocket.close(); } catch (e) {}
+ try { sendSocket.close(); } catch {}
return;
}
diff --git a/test/known_issues/test-url-parse-conformance.js b/test/known_issues/test-url-parse-conformance.js
index 022a613a22..fe3aa718ea 100644
--- a/test/known_issues/test-url-parse-conformance.js
+++ b/test/known_issues/test-url-parse-conformance.js
@@ -40,12 +40,12 @@ tests.forEach((test) => {
assert.strictEqual(test.pathname, parsed.pathname || '/');
assert.strictEqual(test.search, parsed.search || '');
assert.strictEqual(test.hash, parsed.hash || '');
- } catch (err) {
+ } catch {
// For now, we're just interested in the number of failures.
failed++;
}
}
- } catch (err) {
+ } catch {
// If Parse failed and it wasn't supposed to, treat it as a failure.
if (!test.failure)
failed++;
diff --git a/test/message/vm_dont_display_runtime_error.js b/test/message/vm_dont_display_runtime_error.js
index e7c77081a5..72568a21c7 100644
--- a/test/message/vm_dont_display_runtime_error.js
+++ b/test/message/vm_dont_display_runtime_error.js
@@ -30,7 +30,7 @@ try {
filename: 'test.vm',
displayErrors: false
});
-} catch (e) {}
+} catch {}
console.error('middle');
diff --git a/test/message/vm_dont_display_syntax_error.js b/test/message/vm_dont_display_syntax_error.js
index f3965b3343..7e588c5095 100644
--- a/test/message/vm_dont_display_syntax_error.js
+++ b/test/message/vm_dont_display_syntax_error.js
@@ -30,7 +30,7 @@ try {
filename: 'test.vm',
displayErrors: false
});
-} catch (e) {}
+} catch {}
console.error('middle');
diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js
index 8e6c2e52b5..e5a7d1aaaa 100644
--- a/test/parallel/test-assert.js
+++ b/test/parallel/test-assert.js
@@ -168,7 +168,7 @@ assert.throws(
},
Array
);
- } catch (e) {
+ } catch {
threw = true;
}
assert.ok(threw, 'wrong constructor validation');
diff --git a/test/parallel/test-crypto-cipher-decipher.js b/test/parallel/test-crypto-cipher-decipher.js
index 3c0658762f..ed387c3c99 100644
--- a/test/parallel/test-crypto-cipher-decipher.js
+++ b/test/parallel/test-crypto-cipher-decipher.js
@@ -168,13 +168,13 @@ testCipher2(Buffer.from('0123456789abcdef'));
// not assert. See https://github.com/nodejs/node-v0.x-archive/issues/4886.
{
const c = crypto.createCipher('aes-256-cbc', 'secret');
- try { c.final('xxx'); } catch (e) { /* Ignore. */ }
- try { c.final('xxx'); } catch (e) { /* Ignore. */ }
- try { c.final('xxx'); } catch (e) { /* Ignore. */ }
+ try { c.final('xxx'); } catch { /* Ignore. */ }
+ try { c.final('xxx'); } catch { /* Ignore. */ }
+ try { c.final('xxx'); } catch { /* Ignore. */ }
const d = crypto.createDecipher('aes-256-cbc', 'secret');
- try { d.final('xxx'); } catch (e) { /* Ignore. */ }
- try { d.final('xxx'); } catch (e) { /* Ignore. */ }
- try { d.final('xxx'); } catch (e) { /* Ignore. */ }
+ try { d.final('xxx'); } catch { /* Ignore. */ }
+ try { d.final('xxx'); } catch { /* Ignore. */ }
+ try { d.final('xxx'); } catch { /* Ignore. */ }
}
// Regression test for https://github.com/nodejs/node-v0.x-archive/issues/5482:
diff --git a/test/parallel/test-file-write-stream2.js b/test/parallel/test-file-write-stream2.js
index 2db06640e1..e29bd80ebf 100644
--- a/test/parallel/test-file-write-stream2.js
+++ b/test/parallel/test-file-write-stream2.js
@@ -56,7 +56,7 @@ process.on('exit', function() {
function removeTestFile() {
try {
fs.unlinkSync(filepath);
- } catch (e) {}
+ } catch {}
}
diff --git a/test/parallel/test-fs-realpath-pipe.js b/test/parallel/test-fs-realpath-pipe.js
index 55010cf78b..7104e93ff1 100644
--- a/test/parallel/test-fs-realpath-pipe.js
+++ b/test/parallel/test-fs-realpath-pipe.js
@@ -22,7 +22,7 @@ for (const code of [
if (require('fs').realpathSync('/dev/stdin')) {
process.exit(2);
}
- } catch (e) {
+ } catch {
process.exit(1);
}`
]) {
diff --git a/test/parallel/test-fs-realpath.js b/test/parallel/test-fs-realpath.js
index 599616f522..18b9de471b 100644
--- a/test/parallel/test-fs-realpath.js
+++ b/test/parallel/test-fs-realpath.js
@@ -100,7 +100,7 @@ function test_simple_relative_symlink(realpath, realpathSync, callback) {
[
[entry, `../${path.basename(tmpDir)}/cycles/root.js`]
].forEach(function(t) {
- try { fs.unlinkSync(t[0]); } catch (e) {}
+ try { fs.unlinkSync(t[0]); } catch {}
console.log('fs.symlinkSync(%j, %j, %j)', t[1], t[0], 'file');
fs.symlinkSync(t[1], t[0], 'file');
unlink.push(t[0]);
@@ -126,7 +126,7 @@ function test_simple_absolute_symlink(realpath, realpathSync, callback) {
[
[entry, expected]
].forEach(function(t) {
- try { fs.unlinkSync(t[0]); } catch (e) {}
+ try { fs.unlinkSync(t[0]); } catch {}
console.error('fs.symlinkSync(%j, %j, %j)', t[1], t[0], type);
fs.symlinkSync(t[1], t[0], type);
unlink.push(t[0]);
@@ -151,13 +151,13 @@ function test_deep_relative_file_symlink(realpath, realpathSync, callback) {
expected);
const linkPath1 = path.join(targetsAbsDir,
'nested-index', 'one', 'symlink1.js');
- try { fs.unlinkSync(linkPath1); } catch (e) {}
+ try { fs.unlinkSync(linkPath1); } catch {}
fs.symlinkSync(linkData1, linkPath1, 'file');
const linkData2 = '../one/symlink1.js';
const entry = path.join(targetsAbsDir,
'nested-index', 'two', 'symlink1-b.js');
- try { fs.unlinkSync(entry); } catch (e) {}
+ try { fs.unlinkSync(entry); } catch {}
fs.symlinkSync(linkData2, entry, 'file');
unlink.push(linkPath1);
unlink.push(entry);
@@ -178,13 +178,13 @@ function test_deep_relative_dir_symlink(realpath, realpathSync, callback) {
const path1b = path.join(targetsAbsDir, 'nested-index', 'one');
const linkPath1b = path.join(path1b, 'symlink1-dir');
const linkData1b = path.relative(path1b, expected);
- try { fs.unlinkSync(linkPath1b); } catch (e) {}
+ try { fs.unlinkSync(linkPath1b); } catch {}
fs.symlinkSync(linkData1b, linkPath1b, 'dir');
const linkData2b = '../one/symlink1-dir';
const entry = path.join(targetsAbsDir,
'nested-index', 'two', 'symlink12-dir');
- try { fs.unlinkSync(entry); } catch (e) {}
+ try { fs.unlinkSync(entry); } catch {}
fs.symlinkSync(linkData2b, entry, 'dir');
unlink.push(linkPath1b);
unlink.push(entry);
@@ -208,7 +208,7 @@ function test_cyclic_link_protection(realpath, realpathSync, callback) {
[path.join(tmpDir, '/cycles/realpath-3b'), '../cycles/realpath-3c'],
[path.join(tmpDir, '/cycles/realpath-3c'), '../cycles/realpath-3a']
].forEach(function(t) {
- try { fs.unlinkSync(t[0]); } catch (e) {}
+ try { fs.unlinkSync(t[0]); } catch {}
fs.symlinkSync(t[1], t[0], 'dir');
unlink.push(t[0]);
});
@@ -235,7 +235,7 @@ function test_cyclic_link_overprotection(realpath, realpathSync, callback) {
const link = `${folder}/cycles`;
let testPath = cycles;
testPath += '/folder/cycles'.repeat(10);
- try { fs.unlinkSync(link); } catch (ex) {}
+ try { fs.unlinkSync(link); } catch {}
fs.symlinkSync(cycles, link, 'dir');
unlink.push(link);
assertEqualPath(realpathSync(testPath), path.resolve(expected));
@@ -263,7 +263,7 @@ function test_relative_input_cwd(realpath, realpathSync, callback) {
].forEach(function(t) {
const fn = t[0];
console.error('fn=%j', fn);
- try { fs.unlinkSync(fn); } catch (e) {}
+ try { fs.unlinkSync(fn); } catch {}
const b = path.basename(t[1]);
const type = (b === 'root.js' ? 'file' : 'dir');
console.log('fs.symlinkSync(%j, %j, %j)', t[1], fn, type);
@@ -302,8 +302,8 @@ function test_deep_symlink_mix(realpath, realpathSync, callback) {
$tmpDir/targets/cycles/root.js (hard)
*/
const entry = tmp('node-test-realpath-f1');
- try { fs.unlinkSync(tmp('node-test-realpath-d2/foo')); } catch (e) {}
- try { fs.rmdirSync(tmp('node-test-realpath-d2')); } catch (e) {}
+ try { fs.unlinkSync(tmp('node-test-realpath-d2/foo')); } catch {}
+ try { fs.rmdirSync(tmp('node-test-realpath-d2')); } catch {}
fs.mkdirSync(tmp('node-test-realpath-d2'), 0o700);
try {
[
@@ -318,7 +318,7 @@ function test_deep_symlink_mix(realpath, realpathSync, callback) {
[`${targetsAbsDir}/nested-index/two/realpath-c`,
`${tmpDir}/cycles/root.js`]
].forEach(function(t) {
- try { fs.unlinkSync(t[0]); } catch (e) {}
+ try { fs.unlinkSync(t[0]); } catch {}
fs.symlinkSync(t[1], t[0]);
unlink.push(t[0]);
});
@@ -429,14 +429,14 @@ function test_abs_with_kids(realpath, realpathSync, cb) {
['/a/b/c/x.txt',
'/a/link'
].forEach(function(file) {
- try { fs.unlinkSync(root + file); } catch (ex) {}
+ try { fs.unlinkSync(root + file); } catch {}
});
['/a/b/c',
'/a/b',
'/a',
''
].forEach(function(folder) {
- try { fs.rmdirSync(root + folder); } catch (ex) {}
+ try { fs.rmdirSync(root + folder); } catch {}
});
}
function setup() {
diff --git a/test/parallel/test-listen-fd-detached-inherit.js b/test/parallel/test-listen-fd-detached-inherit.js
index b4fce58c93..4feb7dc3ab 100644
--- a/test/parallel/test-listen-fd-detached-inherit.js
+++ b/test/parallel/test-listen-fd-detached-inherit.js
@@ -69,7 +69,7 @@ function test() {
process.kill(child.pid, 'SIGKILL');
try {
parent.kill();
- } catch (e) {}
+ } catch {}
assert.strictEqual(s, 'hello from child\n');
assert.strictEqual(res.statusCode, 200);
diff --git a/test/parallel/test-listen-fd-detached.js b/test/parallel/test-listen-fd-detached.js
index 6fbc938324..09d7f8b6c1 100644
--- a/test/parallel/test-listen-fd-detached.js
+++ b/test/parallel/test-listen-fd-detached.js
@@ -69,7 +69,7 @@ function test() {
process.kill(child.pid, 'SIGKILL');
try {
parent.kill();
- } catch (e) {}
+ } catch {}
assert.strictEqual(s, 'hello from child\n');
assert.strictEqual(res.statusCode, 200);
diff --git a/test/parallel/test-listen-fd-ebadf.js b/test/parallel/test-listen-fd-ebadf.js
index 564dea7f95..3ec40b5c23 100644
--- a/test/parallel/test-listen-fd-ebadf.js
+++ b/test/parallel/test-listen-fd-ebadf.js
@@ -34,7 +34,7 @@ let invalidFd = 2;
// Get first known bad file descriptor.
try {
while (fs.fstatSync(++invalidFd));
-} catch (e) {
+} catch {
// do nothing; we now have an invalid fd
}
diff --git a/test/parallel/test-module-loading-error.js b/test/parallel/test-module-loading-error.js
index 86932bd759..f2351e708f 100644
--- a/test/parallel/test-module-loading-error.js
+++ b/test/parallel/test-module-loading-error.js
@@ -45,7 +45,7 @@ if (common.isWindows) {
try {
// If MUI != 'en' we'll ignore the content of the message
localeOk = execSync(powerShellFindMUI).toString('utf8').trim() === 'en';
- } catch (_) {
+ } catch {
// It's only a best effort try to find the MUI
}
}
diff --git a/test/parallel/test-promises-unhandled-rejections.js b/test/parallel/test-promises-unhandled-rejections.js
index d336630f7c..93ac186a3b 100644
--- a/test/parallel/test-promises-unhandled-rejections.js
+++ b/test/parallel/test-promises-unhandled-rejections.js
@@ -681,7 +681,7 @@ asyncTest('Throwing an error inside a rejectionHandled handler goes to' +
setTimeout(function() {
try {
p.catch(function() {});
- } catch (e) {
+ } catch {
done(new Error('fail'));
}
}, 1);
diff --git a/test/parallel/test-repl-syntax-error-handling.js b/test/parallel/test-repl-syntax-error-handling.js
index f61ab077eb..91a8614d1d 100644
--- a/test/parallel/test-repl-syntax-error-handling.js
+++ b/test/parallel/test-repl-syntax-error-handling.js
@@ -63,7 +63,7 @@ function child() {
let caught;
try {
vm.runInThisContext('haf!@##&$!@$*!@', { displayErrors: false });
- } catch (er) {
+ } catch {
caught = true;
}
assert(caught);
diff --git a/test/parallel/test-require-deps-deprecation.js b/test/parallel/test-require-deps-deprecation.js
index 80bf66d7f6..5bee24a5db 100644
--- a/test/parallel/test-require-deps-deprecation.js
+++ b/test/parallel/test-require-deps-deprecation.js
@@ -34,7 +34,7 @@ common.expectWarning('DeprecationWarning', deprecatedModules.map((m) => {
for (const m of deprecatedModules) {
try {
require(m);
- } catch (err) {}
+ } catch {}
}
// Instead of checking require, check that resolve isn't pointing toward a
diff --git a/test/parallel/test-stdout-close-catch.js b/test/parallel/test-stdout-close-catch.js
index e9b559c9f2..6c0db3ea90 100644
--- a/test/parallel/test-stdout-close-catch.js
+++ b/test/parallel/test-stdout-close-catch.js
@@ -27,7 +27,7 @@ child.stderr.on('data', function(c) {
child.on('close', common.mustCall(function(code) {
try {
output = JSON.parse(output);
- } catch (er) {
+ } catch {
console.error(output);
process.exit(1);
}
diff --git a/test/parallel/test-stdout-to-file.js b/test/parallel/test-stdout-to-file.js
index a02531ca41..f23bbea279 100644
--- a/test/parallel/test-stdout-to-file.js
+++ b/test/parallel/test-stdout-to-file.js
@@ -19,7 +19,7 @@ function test(size, useBuffer, cb) {
try {
fs.unlinkSync(tmpFile);
- } catch (e) {}
+ } catch {}
console.log(`${size} chars to ${tmpFile}...`);
diff --git a/test/parallel/test-vm-low-stack-space.js b/test/parallel/test-vm-low-stack-space.js
index 7c1313d47c..6a49a983d5 100644
--- a/test/parallel/test-vm-low-stack-space.js
+++ b/test/parallel/test-vm-low-stack-space.js
@@ -6,7 +6,7 @@ const vm = require('vm');
function a() {
try {
return a();
- } catch (e) {
+ } catch {
// Throw an exception as near to the recursion-based RangeError as possible.
return vm.runInThisContext('() => 42')();
}
@@ -17,7 +17,7 @@ assert.strictEqual(a(), 42);
function b() {
try {
return b();
- } catch (e) {
+ } catch {
// This writes a lot of noise to stderr, but it still works.
return vm.runInNewContext('() => 42')();
}
diff --git a/test/parallel/test-vm-module-errors.js b/test/parallel/test-vm-module-errors.js
index 0502216083..a343a542a1 100644
--- a/test/parallel/test-vm-module-errors.js
+++ b/test/parallel/test-vm-module-errors.js
@@ -98,7 +98,7 @@ async function checkModuleState() {
const m = new SourceTextModule('import "foo";');
try {
await m.link(common.mustCall(() => ({})));
- } catch (err) {
+ } catch {
assert.strictEqual(m.linkingStatus, 'errored');
m.instantiate();
}
@@ -219,7 +219,7 @@ async function checkLinking() {
const erroredModule = new SourceTextModule('import "foo";');
try {
await erroredModule.link(common.mustCall(() => ({})));
- } catch (err) {
+ } catch {
// ignored
} finally {
assert.strictEqual(erroredModule.linkingStatus, 'errored');
diff --git a/test/parallel/test-vm-parse-abort-on-uncaught-exception.js b/test/parallel/test-vm-parse-abort-on-uncaught-exception.js
index 36f73ea676..4fcff30321 100644
--- a/test/parallel/test-vm-parse-abort-on-uncaught-exception.js
+++ b/test/parallel/test-vm-parse-abort-on-uncaught-exception.js
@@ -7,8 +7,8 @@ const vm = require('vm');
try {
new vm.Script({ toString() { throw new Error('foo'); } }, {});
-} catch (err) {}
+} catch {}
try {
new vm.Script('[', {});
-} catch (err) {}
+} catch {}
diff --git a/test/pummel/test-fs-watch-non-recursive.js b/test/pummel/test-fs-watch-non-recursive.js
index 2b10f9b24d..da11b423a6 100644
--- a/test/pummel/test-fs-watch-non-recursive.js
+++ b/test/pummel/test-fs-watch-non-recursive.js
@@ -31,13 +31,13 @@ const testsubdir = path.join(testDir, 'testsubdir');
const filepath = path.join(testsubdir, 'watch.txt');
function cleanup() {
- try { fs.unlinkSync(filepath); } catch (e) { }
- try { fs.rmdirSync(testsubdir); } catch (e) { }
+ try { fs.unlinkSync(filepath); } catch { }
+ try { fs.rmdirSync(testsubdir); } catch { }
}
process.on('exit', cleanup);
cleanup();
-try { fs.mkdirSync(testsubdir, 0o700); } catch (e) {}
+try { fs.mkdirSync(testsubdir, 0o700); } catch {}
// Need a grace period, else the mkdirSync() above fires off an event.
setTimeout(function() {
diff --git a/test/pummel/test-vm-memleak.js b/test/pummel/test-vm-memleak.js
index cb96512d38..94e4055a76 100644
--- a/test/pummel/test-vm-memleak.js
+++ b/test/pummel/test-vm-memleak.js
@@ -37,7 +37,7 @@ assert(ok, 'Run this test with --max_old_space_size=32.');
const interval = setInterval(function() {
try {
vm.runInNewContext('throw 1;');
- } catch (e) {
+ } catch {
}
const rss = process.memoryUsage().rss;
diff --git a/test/pummel/test-vm-race.js b/test/pummel/test-vm-race.js
index 7f9514b04e..55f63d3168 100644
--- a/test/pummel/test-vm-race.js
+++ b/test/pummel/test-vm-race.js
@@ -25,7 +25,7 @@ do {
try {
script.runInContext(context, { timeout: 5 });
++sandbox.timeout;
- } catch (err) {
+ } catch {
--sandbox.timeout;
}
} while (Date.now() < giveUp);
diff --git a/test/sequential/test-fs-readfile-tostring-fail.js b/test/sequential/test-fs-readfile-tostring-fail.js
index 8dcab75e0f..da8f3930f6 100644
--- a/test/sequential/test-fs-readfile-tostring-fail.js
+++ b/test/sequential/test-fs-readfile-tostring-fail.js
@@ -50,7 +50,7 @@ stream.on('finish', common.mustCall(function() {
function destroy() {
try {
fs.unlinkSync(file);
- } catch (err) {
+ } catch {
// it may not exist
}
}