@@ -248,7 +248,7 @@ function assertCursorRowsAndCols(rli, rows, cols) {
248
248
const expectedLines = [ 'foo' , 'bar' , 'baz' , 'bar' , 'bat' , 'bat' ] ;
249
249
// ['foo', 'baz', 'bar', bat'];
250
250
let callCount = 0 ;
251
- rli . on ( 'line' , function ( line ) {
251
+ rli . on ( 'line' , ( line ) => {
252
252
assert . strictEqual ( line , expectedLines [ callCount ] ) ;
253
253
callCount ++ ;
254
254
} ) ;
@@ -324,7 +324,7 @@ function assertCursorRowsAndCols(rli, rows, cols) {
324
324
} ) ;
325
325
const expectedLines = [ 'foo' , 'bar' , 'baz' , 'bar' , 'bat' , 'bat' ] ;
326
326
let callCount = 0 ;
327
- rli . on ( 'line' , function ( line ) {
327
+ rli . on ( 'line' , ( line ) => {
328
328
assert . strictEqual ( line , expectedLines [ callCount ] ) ;
329
329
callCount ++ ;
330
330
} ) ;
@@ -351,7 +351,7 @@ function assertCursorRowsAndCols(rli, rows, cols) {
351
351
const [ rli , fi ] = getInterface ( { terminal : true } ) ;
352
352
const keys = [ ] ;
353
353
const err = new Error ( 'bad thing happened' ) ;
354
- fi . on ( 'keypress' , function ( key ) {
354
+ fi . on ( 'keypress' , ( key ) => {
355
355
keys . push ( key ) ;
356
356
if ( key === 'X' ) {
357
357
throw err ;
@@ -766,7 +766,7 @@ for (let i = 0; i < 12; i++) {
766
766
assert . strictEqual ( isWarned ( process . stdout . _events ) , false ) ;
767
767
}
768
768
769
- [ true , false ] . forEach ( function ( terminal ) {
769
+ [ true , false ] . forEach ( ( terminal ) => {
770
770
// Disable history
771
771
{
772
772
const [ rli , fi ] = getInterface ( { terminal, historySize : 0 } ) ;
@@ -861,7 +861,7 @@ for (let i = 0; i < 12; i++) {
861
861
const buf = Buffer . from ( '☮' , 'utf8' ) ;
862
862
const [ rli , fi ] = getInterface ( { terminal } ) ;
863
863
let callCount = 0 ;
864
- rli . on ( 'line' , function ( line ) {
864
+ rli . on ( 'line' , ( line ) => {
865
865
callCount ++ ;
866
866
assert . strictEqual ( line , buf . toString ( 'utf8' ) ) ;
867
867
} ) ;
@@ -905,7 +905,7 @@ for (let i = 0; i < 12; i++) {
905
905
rli . setPrompt ( 'ddd> ' ) ;
906
906
rli . prompt ( ) ;
907
907
rli . write ( "really shouldn't be seeing this" ) ;
908
- rli . question ( 'What do you think of node.js? ' , function ( answer ) {
908
+ rli . question ( 'What do you think of node.js? ' , ( answer ) => {
909
909
console . log ( 'Thank you for your valuable feedback:' , answer ) ;
910
910
rli . close ( ) ;
911
911
} ) ;
@@ -957,7 +957,7 @@ for (let i = 0; i < 12; i++) {
957
957
const crlfDelay = 200 ;
958
958
const [ rli , fi ] = getInterface ( { terminal, crlfDelay } ) ;
959
959
let callCount = 0 ;
960
- rli . on ( 'line' , function ( line ) {
960
+ rli . on ( 'line' , ( ) => {
961
961
callCount ++ ;
962
962
} ) ;
963
963
fi . emit ( 'data' , '\r' ) ;
@@ -979,7 +979,7 @@ for (let i = 0; i < 12; i++) {
979
979
const delay = 200 ;
980
980
const [ rli , fi ] = getInterface ( { terminal, crlfDelay } ) ;
981
981
let callCount = 0 ;
982
- rli . on ( 'line' , function ( line ) {
982
+ rli . on ( 'line' , ( ) => {
983
983
callCount ++ ;
984
984
} ) ;
985
985
fi . emit ( 'data' , '\r' ) ;
0 commit comments