@@ -277,7 +277,7 @@ function assertCursorRowsAndCols(rli, rows, cols) {
277
277
const expectedLines = [ 'foo' , 'bar' , 'baz' , 'bar' , 'bat' , 'bat' ] ;
278
278
// ['foo', 'baz', 'bar', bat'];
279
279
let callCount = 0 ;
280
- rli . on ( 'line' , function ( line ) {
280
+ rli . on ( 'line' , ( line ) => {
281
281
assert . strictEqual ( line , expectedLines [ callCount ] ) ;
282
282
callCount ++ ;
283
283
} ) ;
@@ -353,7 +353,7 @@ function assertCursorRowsAndCols(rli, rows, cols) {
353
353
} ) ;
354
354
const expectedLines = [ 'foo' , 'bar' , 'baz' , 'bar' , 'bat' , 'bat' ] ;
355
355
let callCount = 0 ;
356
- rli . on ( 'line' , function ( line ) {
356
+ rli . on ( 'line' , ( line ) => {
357
357
assert . strictEqual ( line , expectedLines [ callCount ] ) ;
358
358
callCount ++ ;
359
359
} ) ;
@@ -380,7 +380,7 @@ function assertCursorRowsAndCols(rli, rows, cols) {
380
380
const [ rli , fi ] = getInterface ( { terminal : true } ) ;
381
381
const keys = [ ] ;
382
382
const err = new Error ( 'bad thing happened' ) ;
383
- fi . on ( 'keypress' , function ( key ) {
383
+ fi . on ( 'keypress' , ( key ) => {
384
384
keys . push ( key ) ;
385
385
if ( key === 'X' ) {
386
386
throw err ;
@@ -795,7 +795,7 @@ for (let i = 0; i < 12; i++) {
795
795
assert . strictEqual ( isWarned ( process . stdout . _events ) , false ) ;
796
796
}
797
797
798
- [ true , false ] . forEach ( function ( terminal ) {
798
+ [ true , false ] . forEach ( ( terminal ) => {
799
799
// Disable history
800
800
{
801
801
const [ rli , fi ] = getInterface ( { terminal, historySize : 0 } ) ;
@@ -890,7 +890,7 @@ for (let i = 0; i < 12; i++) {
890
890
const buf = Buffer . from ( '☮' , 'utf8' ) ;
891
891
const [ rli , fi ] = getInterface ( { terminal } ) ;
892
892
let callCount = 0 ;
893
- rli . on ( 'line' , function ( line ) {
893
+ rli . on ( 'line' , ( line ) => {
894
894
callCount ++ ;
895
895
assert . strictEqual ( line , buf . toString ( 'utf8' ) ) ;
896
896
} ) ;
@@ -1004,7 +1004,7 @@ for (let i = 0; i < 12; i++) {
1004
1004
rli . setPrompt ( 'ddd> ' ) ;
1005
1005
rli . prompt ( ) ;
1006
1006
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 ) => {
1008
1008
console . log ( 'Thank you for your valuable feedback:' , answer ) ;
1009
1009
rli . close ( ) ;
1010
1010
} ) ;
@@ -1056,7 +1056,7 @@ for (let i = 0; i < 12; i++) {
1056
1056
const crlfDelay = 200 ;
1057
1057
const [ rli , fi ] = getInterface ( { terminal, crlfDelay } ) ;
1058
1058
let callCount = 0 ;
1059
- rli . on ( 'line' , function ( line ) {
1059
+ rli . on ( 'line' , ( ) => {
1060
1060
callCount ++ ;
1061
1061
} ) ;
1062
1062
fi . emit ( 'data' , '\r' ) ;
@@ -1078,7 +1078,7 @@ for (let i = 0; i < 12; i++) {
1078
1078
const delay = 200 ;
1079
1079
const [ rli , fi ] = getInterface ( { terminal, crlfDelay } ) ;
1080
1080
let callCount = 0 ;
1081
- rli . on ( 'line' , function ( line ) {
1081
+ rli . on ( 'line' , ( ) => {
1082
1082
callCount ++ ;
1083
1083
} ) ;
1084
1084
fi . emit ( 'data' , '\r' ) ;
0 commit comments