@@ -277,7 +277,7 @@ function assertCursorRowsAndCols(rli, rows, cols) {
277277 const expectedLines = [ 'foo' , 'bar' , 'baz' , 'bar' , 'bat' , 'bat' ] ;
278278 // ['foo', 'baz', 'bar', bat'];
279279 let callCount = 0 ;
280- rli . on ( 'line' , function ( line ) {
280+ rli . on ( 'line' , ( line ) => {
281281 assert . strictEqual ( line , expectedLines [ callCount ] ) ;
282282 callCount ++ ;
283283 } ) ;
@@ -353,7 +353,7 @@ function assertCursorRowsAndCols(rli, rows, cols) {
353353 } ) ;
354354 const expectedLines = [ 'foo' , 'bar' , 'baz' , 'bar' , 'bat' , 'bat' ] ;
355355 let callCount = 0 ;
356- rli . on ( 'line' , function ( line ) {
356+ rli . on ( 'line' , ( line ) => {
357357 assert . strictEqual ( line , expectedLines [ callCount ] ) ;
358358 callCount ++ ;
359359 } ) ;
@@ -380,7 +380,7 @@ function assertCursorRowsAndCols(rli, rows, cols) {
380380 const [ rli , fi ] = getInterface ( { terminal : true } ) ;
381381 const keys = [ ] ;
382382 const err = new Error ( 'bad thing happened' ) ;
383- fi . on ( 'keypress' , function ( key ) {
383+ fi . on ( 'keypress' , ( key ) => {
384384 keys . push ( key ) ;
385385 if ( key === 'X' ) {
386386 throw err ;
@@ -795,7 +795,7 @@ for (let i = 0; i < 12; i++) {
795795 assert . strictEqual ( isWarned ( process . stdout . _events ) , false ) ;
796796}
797797
798- [ true , false ] . forEach ( function ( terminal ) {
798+ [ true , false ] . forEach ( ( terminal ) => {
799799 // Disable history
800800 {
801801 const [ rli , fi ] = getInterface ( { terminal, historySize : 0 } ) ;
@@ -890,7 +890,7 @@ for (let i = 0; i < 12; i++) {
890890 const buf = Buffer . from ( '☮' , 'utf8' ) ;
891891 const [ rli , fi ] = getInterface ( { terminal } ) ;
892892 let callCount = 0 ;
893- rli . on ( 'line' , function ( line ) {
893+ rli . on ( 'line' , ( line ) => {
894894 callCount ++ ;
895895 assert . strictEqual ( line , buf . toString ( 'utf8' ) ) ;
896896 } ) ;
@@ -1004,7 +1004,7 @@ for (let i = 0; i < 12; i++) {
10041004 rli . setPrompt ( 'ddd> ' ) ;
10051005 rli . prompt ( ) ;
10061006 rli . write ( "really shouldn't be seeing this" ) ;
1007- rli . question ( 'What do you think of node.js? ' , function ( answer ) {
1007+ rli . question ( 'What do you think of node.js? ' , ( answer ) => {
10081008 console . log ( 'Thank you for your valuable feedback:' , answer ) ;
10091009 rli . close ( ) ;
10101010 } ) ;
@@ -1056,7 +1056,7 @@ for (let i = 0; i < 12; i++) {
10561056 const crlfDelay = 200 ;
10571057 const [ rli , fi ] = getInterface ( { terminal, crlfDelay } ) ;
10581058 let callCount = 0 ;
1059- rli . on ( 'line' , function ( line ) {
1059+ rli . on ( 'line' , ( ) => {
10601060 callCount ++ ;
10611061 } ) ;
10621062 fi . emit ( 'data' , '\r' ) ;
@@ -1078,7 +1078,7 @@ for (let i = 0; i < 12; i++) {
10781078 const delay = 200 ;
10791079 const [ rli , fi ] = getInterface ( { terminal, crlfDelay } ) ;
10801080 let callCount = 0 ;
1081- rli . on ( 'line' , function ( line ) {
1081+ rli . on ( 'line' , ( ) => {
10821082 callCount ++ ;
10831083 } ) ;
10841084 fi . emit ( 'data' , '\r' ) ;
0 commit comments