pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/nodejs/node/commit/78be4771a6189ea8082f366b56b37e9d97de62fd

imer-b69241e157469407.css" /> test: remove unused catch bindings · nodejs/node@78be477 · GitHub
Skip to content

Commit 78be477

Browse files
cjihrigMylesBorins
authored andcommitted
test: remove unused catch bindings
PR-URL: #24079 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Wyatt Preul <wpreul@gmail.com>
1 parent 4b456d5 commit 78be477

30 files changed

+57
-57
lines changed

test/common/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ function canCreateSymLink() {
371371
try {
372372
const output = execSync(`${whoamiPath} /priv`, { timout: 1000 });
373373
return output.includes('SeCreateSymbolicLinkPrivilege');
374-
} catch (e) {
374+
} catch {
375375
return false;
376376
}
377377
}
@@ -455,7 +455,7 @@ function isAlive(pid) {
455455
try {
456456
process.kill(pid, 'SIGCONT');
457457
return true;
458-
} catch (e) {
458+
} catch {
459459
return false;
460460
}
461461
}
@@ -664,7 +664,7 @@ function getTTYfd() {
664664
if (ttyFd === undefined) {
665665
try {
666666
return fs.openSync('/dev/tty');
667-
} catch (e) {
667+
} catch {
668668
// There aren't any tty fd's available to use.
669669
return -1;
670670
}
@@ -678,7 +678,7 @@ function runWithInvalidFD(func) {
678678
// be an valid one.
679679
try {
680680
while (fs.fstatSync(fd--) && fd > 0);
681-
} catch (e) {
681+
} catch {
682682
return func(fd);
683683
}
684684

test/doctool/test-doctool-html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const common = require('../common');
44
// The doctool currently uses js-yaml from the tool/node_modules/eslint/ tree.
55
try {
66
require('../../tools/node_modules/eslint/node_modules/js-yaml');
7-
} catch (e) {
7+
} catch {
88
common.skip('missing js-yaml (eslint not present)');
99
}
1010

test/doctool/test-doctool-json.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const common = require('../common');
44
// The doctool currently uses js-yaml from the tool/node_modules/eslint/ tree.
55
try {
66
require('../../tools/node_modules/eslint/node_modules/js-yaml');
7-
} catch (e) {
7+
} catch {
88
common.skip('missing js-yaml (eslint not present)');
99
}
1010

test/fixtures/catch-stdout-error.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
function write() {
2323
try {
2424
process.stdout.write('Hello, world\n');
25-
} catch (ex) {
25+
} catch {
2626
throw new Error('this should never happen');
2727
}
2828
setImmediate(function() {

test/internet/test-dgram-broadcast-multi-process.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ if (process.argv[2] !== 'child') {
182182
const buf = messages[i++];
183183

184184
if (!buf) {
185-
try { sendSocket.close(); } catch (e) {}
185+
try { sendSocket.close(); } catch {}
186186
return;
187187
}
188188

test/internet/test-dgram-multicast-multi-process.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ if (process.argv[2] !== 'child') {
170170
const buf = messages[i++];
171171

172172
if (!buf) {
173-
try { sendSocket.close(); } catch (e) {}
173+
try { sendSocket.close(); } catch {}
174174
return;
175175
}
176176

test/known_issues/test-url-parse-conformance.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ tests.forEach((test) => {
4040
assert.strictEqual(test.pathname, parsed.pathname || '/');
4141
assert.strictEqual(test.search, parsed.search || '');
4242
assert.strictEqual(test.hash, parsed.hash || '');
43-
} catch (err) {
43+
} catch {
4444
// For now, we're just interested in the number of failures.
4545
failed++;
4646
}
4747
}
48-
} catch (err) {
48+
} catch {
4949
// If Parse failed and it wasn't supposed to, treat it as a failure.
5050
if (!test.failure)
5151
failed++;

test/message/vm_dont_display_runtime_error.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ try {
3030
filename: 'test.vm',
3131
displayErrors: false
3232
});
33-
} catch (e) {}
33+
} catch {}
3434

3535
console.error('middle');
3636

test/message/vm_dont_display_syntax_error.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ try {
3030
filename: 'test.vm',
3131
displayErrors: false
3232
});
33-
} catch (e) {}
33+
} catch {}
3434

3535
console.error('middle');
3636

test/parallel/test-assert.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ assert.throws(
166166
},
167167
Array
168168
);
169-
} catch (e) {
169+
} catch {
170170
threw = true;
171171
}
172172
assert.ok(threw, 'wrong constructor validation');

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy