@@ -108,7 +108,7 @@ const kContextId = Symbol('contextId');
108
108
try {
109
109
// Hack for require.resolve("./relative") to work properly.
110
110
module . filename = path . resolve ( 'repl' ) ;
111
- } catch ( e ) {
111
+ } catch {
112
112
// path.resolve('repl') fails when the current working directory has been
113
113
// deleted. Fall back to the directory name of the (absolute) executable
114
114
// path. It's not really correct but what are the alternatives?
@@ -1051,7 +1051,7 @@ function complete(line, callback) {
1051
1051
dir = path . resolve ( paths [ i ] , subdir ) ;
1052
1052
try {
1053
1053
files = fs . readdirSync ( dir ) ;
1054
- } catch ( e ) {
1054
+ } catch {
1055
1055
continue ;
1056
1056
}
1057
1057
for ( f = 0 ; f < files . length ; f ++ ) {
@@ -1065,14 +1065,14 @@ function complete(line, callback) {
1065
1065
abs = path . resolve ( dir , name ) ;
1066
1066
try {
1067
1067
isDirectory = fs . statSync ( abs ) . isDirectory ( ) ;
1068
- } catch ( e ) {
1068
+ } catch {
1069
1069
continue ;
1070
1070
}
1071
1071
if ( isDirectory ) {
1072
1072
group . push ( subdir + name + '/' ) ;
1073
1073
try {
1074
1074
subfiles = fs . readdirSync ( abs ) ;
1075
- } catch ( e ) {
1075
+ } catch {
1076
1076
continue ;
1077
1077
}
1078
1078
for ( s = 0 ; s < subfiles . length ; s ++ ) {
@@ -1154,13 +1154,13 @@ function complete(line, callback) {
1154
1154
} ) ;
1155
1155
}
1156
1156
} else {
1157
- const evalExpr = `try { ${ expr } } catch (e) {}` ;
1157
+ const evalExpr = `try { ${ expr } } catch {}` ;
1158
1158
this . eval ( evalExpr , this . context , 'repl' , ( e , obj ) => {
1159
1159
if ( obj != null ) {
1160
1160
if ( typeof obj === 'object' || typeof obj === 'function' ) {
1161
1161
try {
1162
1162
memberGroups . push ( filteredOwnPropertyNames . call ( this , obj ) ) ;
1163
- } catch ( ex ) {
1163
+ } catch {
1164
1164
// Probably a Proxy object without `getOwnPropertyNames` trap.
1165
1165
// We simply ignore it here, as we don't want to break the
1166
1166
// autocompletion. Fixes the bug
@@ -1185,7 +1185,7 @@ function complete(line, callback) {
1185
1185
break ;
1186
1186
}
1187
1187
}
1188
- } catch ( e ) { }
1188
+ } catch { }
1189
1189
}
1190
1190
1191
1191
if ( memberGroups . length ) {
@@ -1458,7 +1458,7 @@ function defineDefaultCommands(repl) {
1458
1458
try {
1459
1459
fs . writeFileSync ( file , this . lines . join ( '\n' ) + '\n' ) ;
1460
1460
this . outputStream . write ( 'Session saved to: ' + file + '\n' ) ;
1461
- } catch ( e ) {
1461
+ } catch {
1462
1462
this . outputStream . write ( 'Failed to save: ' + file + '\n' ) ;
1463
1463
}
1464
1464
this . displayPrompt ( ) ;
0 commit comments