@@ -100,7 +100,7 @@ function test_simple_relative_symlink(realpath, realpathSync, callback) {
100
100
[
101
101
[ entry , `../${ path . basename ( tmpDir ) } /cycles/root.js` ]
102
102
] . forEach ( function ( t ) {
103
- try { fs . unlinkSync ( t [ 0 ] ) ; } catch ( e ) { }
103
+ try { fs . unlinkSync ( t [ 0 ] ) ; } catch { }
104
104
console . log ( 'fs.symlinkSync(%j, %j, %j)' , t [ 1 ] , t [ 0 ] , 'file' ) ;
105
105
fs . symlinkSync ( t [ 1 ] , t [ 0 ] , 'file' ) ;
106
106
unlink . push ( t [ 0 ] ) ;
@@ -126,7 +126,7 @@ function test_simple_absolute_symlink(realpath, realpathSync, callback) {
126
126
[
127
127
[ entry , expected ]
128
128
] . forEach ( function ( t ) {
129
- try { fs . unlinkSync ( t [ 0 ] ) ; } catch ( e ) { }
129
+ try { fs . unlinkSync ( t [ 0 ] ) ; } catch { }
130
130
console . error ( 'fs.symlinkSync(%j, %j, %j)' , t [ 1 ] , t [ 0 ] , type ) ;
131
131
fs . symlinkSync ( t [ 1 ] , t [ 0 ] , type ) ;
132
132
unlink . push ( t [ 0 ] ) ;
@@ -151,13 +151,13 @@ function test_deep_relative_file_symlink(realpath, realpathSync, callback) {
151
151
expected ) ;
152
152
const linkPath1 = path . join ( targetsAbsDir ,
153
153
'nested-index' , 'one' , 'symlink1.js' ) ;
154
- try { fs . unlinkSync ( linkPath1 ) ; } catch ( e ) { }
154
+ try { fs . unlinkSync ( linkPath1 ) ; } catch { }
155
155
fs . symlinkSync ( linkData1 , linkPath1 , 'file' ) ;
156
156
157
157
const linkData2 = '../one/symlink1.js' ;
158
158
const entry = path . join ( targetsAbsDir ,
159
159
'nested-index' , 'two' , 'symlink1-b.js' ) ;
160
- try { fs . unlinkSync ( entry ) ; } catch ( e ) { }
160
+ try { fs . unlinkSync ( entry ) ; } catch { }
161
161
fs . symlinkSync ( linkData2 , entry , 'file' ) ;
162
162
unlink . push ( linkPath1 ) ;
163
163
unlink . push ( entry ) ;
@@ -178,13 +178,13 @@ function test_deep_relative_dir_symlink(realpath, realpathSync, callback) {
178
178
const path1b = path . join ( targetsAbsDir , 'nested-index' , 'one' ) ;
179
179
const linkPath1b = path . join ( path1b , 'symlink1-dir' ) ;
180
180
const linkData1b = path . relative ( path1b , expected ) ;
181
- try { fs . unlinkSync ( linkPath1b ) ; } catch ( e ) { }
181
+ try { fs . unlinkSync ( linkPath1b ) ; } catch { }
182
182
fs . symlinkSync ( linkData1b , linkPath1b , 'dir' ) ;
183
183
184
184
const linkData2b = '../one/symlink1-dir' ;
185
185
const entry = path . join ( targetsAbsDir ,
186
186
'nested-index' , 'two' , 'symlink12-dir' ) ;
187
- try { fs . unlinkSync ( entry ) ; } catch ( e ) { }
187
+ try { fs . unlinkSync ( entry ) ; } catch { }
188
188
fs . symlinkSync ( linkData2b , entry , 'dir' ) ;
189
189
unlink . push ( linkPath1b ) ;
190
190
unlink . push ( entry ) ;
@@ -208,7 +208,7 @@ function test_cyclic_link_protection(realpath, realpathSync, callback) {
208
208
[ path . join ( tmpDir , '/cycles/realpath-3b' ) , '../cycles/realpath-3c' ] ,
209
209
[ path . join ( tmpDir , '/cycles/realpath-3c' ) , '../cycles/realpath-3a' ]
210
210
] . forEach ( function ( t ) {
211
- try { fs . unlinkSync ( t [ 0 ] ) ; } catch ( e ) { }
211
+ try { fs . unlinkSync ( t [ 0 ] ) ; } catch { }
212
212
fs . symlinkSync ( t [ 1 ] , t [ 0 ] , 'dir' ) ;
213
213
unlink . push ( t [ 0 ] ) ;
214
214
} ) ;
@@ -235,7 +235,7 @@ function test_cyclic_link_overprotection(realpath, realpathSync, callback) {
235
235
const link = `${ folder } /cycles` ;
236
236
let testPath = cycles ;
237
237
testPath += '/folder/cycles' . repeat ( 10 ) ;
238
- try { fs . unlinkSync ( link ) ; } catch ( ex ) { }
238
+ try { fs . unlinkSync ( link ) ; } catch { }
239
239
fs . symlinkSync ( cycles , link , 'dir' ) ;
240
240
unlink . push ( link ) ;
241
241
assertEqualPath ( realpathSync ( testPath ) , path . resolve ( expected ) ) ;
@@ -263,7 +263,7 @@ function test_relative_input_cwd(realpath, realpathSync, callback) {
263
263
] . forEach ( function ( t ) {
264
264
const fn = t [ 0 ] ;
265
265
console . error ( 'fn=%j' , fn ) ;
266
- try { fs . unlinkSync ( fn ) ; } catch ( e ) { }
266
+ try { fs . unlinkSync ( fn ) ; } catch { }
267
267
const b = path . basename ( t [ 1 ] ) ;
268
268
const type = ( b === 'root.js' ? 'file' : 'dir' ) ;
269
269
console . log ( 'fs.symlinkSync(%j, %j, %j)' , t [ 1 ] , fn , type ) ;
@@ -302,8 +302,8 @@ function test_deep_symlink_mix(realpath, realpathSync, callback) {
302
302
$tmpDir/targets/cycles/root.js (hard)
303
303
*/
304
304
const entry = tmp ( 'node-test-realpath-f1' ) ;
305
- try { fs . unlinkSync ( tmp ( 'node-test-realpath-d2/foo' ) ) ; } catch ( e ) { }
306
- try { fs . rmdirSync ( tmp ( 'node-test-realpath-d2' ) ) ; } catch ( e ) { }
305
+ try { fs . unlinkSync ( tmp ( 'node-test-realpath-d2/foo' ) ) ; } catch { }
306
+ try { fs . rmdirSync ( tmp ( 'node-test-realpath-d2' ) ) ; } catch { }
307
307
fs . mkdirSync ( tmp ( 'node-test-realpath-d2' ) , 0o700 ) ;
308
308
try {
309
309
[
@@ -318,7 +318,7 @@ function test_deep_symlink_mix(realpath, realpathSync, callback) {
318
318
[ `${ targetsAbsDir } /nested-index/two/realpath-c` ,
319
319
`${ tmpDir } /cycles/root.js` ]
320
320
] . forEach ( function ( t ) {
321
- try { fs . unlinkSync ( t [ 0 ] ) ; } catch ( e ) { }
321
+ try { fs . unlinkSync ( t [ 0 ] ) ; } catch { }
322
322
fs . symlinkSync ( t [ 1 ] , t [ 0 ] ) ;
323
323
unlink . push ( t [ 0 ] ) ;
324
324
} ) ;
@@ -429,14 +429,14 @@ function test_abs_with_kids(realpath, realpathSync, cb) {
429
429
[ '/a/b/c/x.txt' ,
430
430
'/a/link'
431
431
] . forEach ( function ( file ) {
432
- try { fs . unlinkSync ( root + file ) ; } catch ( ex ) { }
432
+ try { fs . unlinkSync ( root + file ) ; } catch { }
433
433
} ) ;
434
434
[ '/a/b/c' ,
435
435
'/a/b' ,
436
436
'/a' ,
437
437
''
438
438
] . forEach ( function ( folder ) {
439
- try { fs . rmdirSync ( root + folder ) ; } catch ( ex ) { }
439
+ try { fs . rmdirSync ( root + folder ) ; } catch { }
440
440
} ) ;
441
441
}
442
442
function setup ( ) {
0 commit comments