@@ -9,25 +9,25 @@ const opts = { shell: common.isWindows };
9
9
10
10
const p = cp . spawn ( 'echo' , [ ] , opts ) ;
11
11
12
- p . on ( 'close' , common . mustCall ( function ( code , signal ) {
12
+ p . on ( 'close' , common . mustCall ( ( code , signal ) => {
13
13
assert . strictEqual ( code , 0 ) ;
14
14
assert . strictEqual ( signal , null ) ;
15
15
spawnWithReadable ( ) ;
16
16
} ) ) ;
17
17
18
18
p . stdout . read ( ) ;
19
19
20
- function spawnWithReadable ( ) {
20
+ const spawnWithReadable = ( ) => {
21
21
const buffer = [ ] ;
22
22
const p = cp . spawn ( 'echo' , [ '123' ] , opts ) ;
23
- p . on ( 'close' , common . mustCall ( function ( code , signal ) {
23
+ p . on ( 'close' , common . mustCall ( ( code , signal ) => {
24
24
assert . strictEqual ( code , 0 ) ;
25
25
assert . strictEqual ( signal , null ) ;
26
26
assert . strictEqual ( Buffer . concat ( buffer ) . toString ( ) . trim ( ) , '123' ) ;
27
27
} ) ) ;
28
- p . stdout . on ( 'readable' , function ( ) {
28
+ p . stdout . on ( 'readable' , ( ) => {
29
29
let buf ;
30
- while ( buf = this . read ( ) )
30
+ while ( buf = p . stdout . read ( ) )
31
31
buffer . push ( buf ) ;
32
32
} ) ;
33
- }
33
+ } ;
0 commit comments