2828'use strict' ;
2929
3030const {
31+ DateNow,
3132 MathCeil,
3233 MathFloor,
3334 MathMax,
@@ -438,7 +439,7 @@ Interface.prototype._normalWrite = function(b) {
438439 }
439440 let string = this . _decoder . write ( b ) ;
440441 if ( this . _sawReturnAt &&
441- Date . now ( ) - this . _sawReturnAt <= this . crlfDelay ) {
442+ DateNow ( ) - this . _sawReturnAt <= this . crlfDelay ) {
442443 string = string . replace ( / ^ \n / , '' ) ;
443444 this . _sawReturnAt = 0 ;
444445 }
@@ -451,7 +452,7 @@ Interface.prototype._normalWrite = function(b) {
451452 this . _line_buffer = null ;
452453 }
453454 if ( newPartContainsEnding ) {
454- this . _sawReturnAt = string . endsWith ( '\r' ) ? Date . now ( ) : 0 ;
455+ this . _sawReturnAt = string . endsWith ( '\r' ) ? DateNow ( ) : 0 ;
455456
456457 // Got one or more newlines; process into "line" events
457458 const lines = string . split ( lineEnding ) ;
@@ -834,14 +835,14 @@ function _ttyWriteDumb(s, key) {
834835
835836 switch ( key . name ) {
836837 case 'return' : // Carriage return, i.e. \r
837- this . _sawReturnAt = Date . now ( ) ;
838+ this . _sawReturnAt = DateNow ( ) ;
838839 this . _line ( ) ;
839840 break ;
840841
841842 case 'enter' :
842843 // When key interval > crlfDelay
843844 if ( this . _sawReturnAt === 0 ||
844- Date . now ( ) - this . _sawReturnAt > this . crlfDelay ) {
845+ DateNow ( ) - this . _sawReturnAt > this . crlfDelay ) {
845846 this . _line ( ) ;
846847 }
847848 this . _sawReturnAt = 0 ;
@@ -1015,14 +1016,14 @@ Interface.prototype._ttyWrite = function(s, key) {
10151016
10161017 switch ( key . name ) {
10171018 case 'return' : // Carriage return, i.e. \r
1018- this . _sawReturnAt = Date . now ( ) ;
1019+ this . _sawReturnAt = DateNow ( ) ;
10191020 this . _line ( ) ;
10201021 break ;
10211022
10221023 case 'enter' :
10231024 // When key interval > crlfDelay
10241025 if ( this . _sawReturnAt === 0 ||
1025- Date . now ( ) - this . _sawReturnAt > this . crlfDelay ) {
1026+ DateNow ( ) - this . _sawReturnAt > this . crlfDelay ) {
10261027 this . _line ( ) ;
10271028 }
10281029 this . _sawReturnAt = 0 ;
0 commit comments