@@ -6,19 +6,17 @@ const common = require('../common');
6
6
//
7
7
// Refer: https://github.com/nodejs/node/issues/7655
8
8
9
- const assert = require ( 'assert' ) ;
10
9
const fs = require ( 'fs' ) ;
11
10
const path = require ( 'path' ) ;
12
11
13
- const errHandler = ( e ) => assert . ifError ( e ) ;
14
12
const options = Object . freeze ( { } ) ;
15
13
const tmpdir = require ( '../common/tmpdir' ) ;
16
14
tmpdir . refresh ( ) ;
17
15
18
- fs . readFile ( __filename , options , common . mustCall ( errHandler ) ) ;
16
+ fs . readFile ( __filename , options , common . mustSucceed ( ) ) ;
19
17
fs . readFileSync ( __filename , options ) ;
20
18
21
- fs . readdir ( __dirname , options , common . mustCall ( errHandler ) ) ;
19
+ fs . readdir ( __dirname , options , common . mustSucceed ( ) ) ;
22
20
fs . readdirSync ( __dirname , options ) ;
23
21
24
22
if ( common . canCreateSymLink ( ) ) {
@@ -28,20 +26,20 @@ if (common.canCreateSymLink()) {
28
26
fs . writeFileSync ( sourceFile , '' ) ;
29
27
fs . symlinkSync ( sourceFile , linkFile ) ;
30
28
31
- fs . readlink ( linkFile , options , common . mustCall ( errHandler ) ) ;
29
+ fs . readlink ( linkFile , options , common . mustSucceed ( ) ) ;
32
30
fs . readlinkSync ( linkFile , options ) ;
33
31
}
34
32
35
33
{
36
34
const fileName = path . resolve ( tmpdir . path , 'writeFile' ) ;
37
35
fs . writeFileSync ( fileName , 'ABCD' , options ) ;
38
- fs . writeFile ( fileName , 'ABCD' , options , common . mustCall ( errHandler ) ) ;
36
+ fs . writeFile ( fileName , 'ABCD' , options , common . mustSucceed ( ) ) ;
39
37
}
40
38
41
39
{
42
40
const fileName = path . resolve ( tmpdir . path , 'appendFile' ) ;
43
41
fs . appendFileSync ( fileName , 'ABCD' , options ) ;
44
- fs . appendFile ( fileName , 'ABCD' , options , common . mustCall ( errHandler ) ) ;
42
+ fs . appendFile ( fileName , 'ABCD' , options , common . mustSucceed ( ) ) ;
45
43
}
46
44
47
45
if ( ! common . isIBMi ) { // IBMi does not support fs.watch()
@@ -56,13 +54,13 @@ if (!common.isIBMi) { // IBMi does not support fs.watch()
56
54
57
55
{
58
56
fs . realpathSync ( __filename , options ) ;
59
- fs . realpath ( __filename , options , common . mustCall ( errHandler ) ) ;
57
+ fs . realpath ( __filename , options , common . mustSucceed ( ) ) ;
60
58
}
61
59
62
60
{
63
61
const tempFileName = path . resolve ( tmpdir . path , 'mkdtemp-' ) ;
64
62
fs . mkdtempSync ( tempFileName , options ) ;
65
- fs . mkdtemp ( tempFileName , options , common . mustCall ( errHandler ) ) ;
63
+ fs . mkdtemp ( tempFileName , options , common . mustSucceed ( ) ) ;
66
64
}
67
65
68
66
{
0 commit comments