@@ -107,7 +107,7 @@ const kContextId = Symbol('contextId');
107
107
try {
108
108
// Hack for require.resolve("./relative") to work properly.
109
109
module . filename = path . resolve ( 'repl' ) ;
110
- } catch ( e ) {
110
+ } catch {
111
111
// path.resolve('repl') fails when the current working directory has been
112
112
// deleted. Fall back to the directory name of the (absolute) executable
113
113
// path. It's not really correct but what are the alternatives?
@@ -1046,7 +1046,7 @@ function complete(line, callback) {
1046
1046
dir = path . resolve ( paths [ i ] , subdir ) ;
1047
1047
try {
1048
1048
files = fs . readdirSync ( dir ) ;
1049
- } catch ( e ) {
1049
+ } catch {
1050
1050
continue ;
1051
1051
}
1052
1052
for ( f = 0 ; f < files . length ; f ++ ) {
@@ -1060,14 +1060,14 @@ function complete(line, callback) {
1060
1060
abs = path . resolve ( dir , name ) ;
1061
1061
try {
1062
1062
isDirectory = fs . statSync ( abs ) . isDirectory ( ) ;
1063
- } catch ( e ) {
1063
+ } catch {
1064
1064
continue ;
1065
1065
}
1066
1066
if ( isDirectory ) {
1067
1067
group . push ( subdir + name + '/' ) ;
1068
1068
try {
1069
1069
subfiles = fs . readdirSync ( abs ) ;
1070
- } catch ( e ) {
1070
+ } catch {
1071
1071
continue ;
1072
1072
}
1073
1073
for ( s = 0 ; s < subfiles . length ; s ++ ) {
@@ -1149,13 +1149,13 @@ function complete(line, callback) {
1149
1149
} ) ;
1150
1150
}
1151
1151
} else {
1152
- const evalExpr = `try { ${ expr } } catch (e) {}` ;
1152
+ const evalExpr = `try { ${ expr } } catch {}` ;
1153
1153
this . eval ( evalExpr , this . context , 'repl' , ( e , obj ) => {
1154
1154
if ( obj != null ) {
1155
1155
if ( typeof obj === 'object' || typeof obj === 'function' ) {
1156
1156
try {
1157
1157
memberGroups . push ( filteredOwnPropertyNames . call ( this , obj ) ) ;
1158
- } catch ( ex ) {
1158
+ } catch {
1159
1159
// Probably a Proxy object without `getOwnPropertyNames` trap.
1160
1160
// We simply ignore it here, as we don't want to break the
1161
1161
// autocompletion. Fixes the bug
@@ -1180,7 +1180,7 @@ function complete(line, callback) {
1180
1180
break ;
1181
1181
}
1182
1182
}
1183
- } catch ( e ) { }
1183
+ } catch { }
1184
1184
}
1185
1185
1186
1186
if ( memberGroups . length ) {
@@ -1453,7 +1453,7 @@ function defineDefaultCommands(repl) {
1453
1453
try {
1454
1454
fs . writeFileSync ( file , this . lines . join ( '\n' ) + '\n' ) ;
1455
1455
this . outputStream . write ( 'Session saved to: ' + file + '\n' ) ;
1456
- } catch ( e ) {
1456
+ } catch {
1457
1457
this . outputStream . write ( 'Failed to save: ' + file + '\n' ) ;
1458
1458
}
1459
1459
this . displayPrompt ( ) ;
0 commit comments