@@ -690,7 +690,7 @@ function intFilter(item) {
690690 return / ^ [ A - Z a - z _ $ ] / . test ( item ) ;
691691}
692692
693- const DEFAULT_PROPERTIES = {
693+ const defaultProperties = {
694694 ARRAY : Object . getOwnPropertyNames ( [ ] ) . filter ( intFilter ) ,
695695 BUFFER : Object . getOwnPropertyNames ( Buffer . alloc ( 1 ) ) . filter ( intFilter )
696696} ;
@@ -704,16 +704,16 @@ function filteredOwnPropertyNames(obj) {
704704 if ( mayBeLargeObject ( obj ) && obj . length > 1e6 ) {
705705 this . _writeToOutput ( '\r\n' ) ;
706706 process . emitWarning (
707- 'Instance is too large that the completion may missing ' +
708- 'some customized properties.' ,
707+ 'Instance is too large so the completion may missing some custom ' +
708+ 'properties.' ,
709709 'REPLWarning' ,
710710 undefined ,
711711 undefined ,
712712 true ) ;
713713
714714 return Array . isArray ( obj ) ?
715- DEFAULT_PROPERTIES . ARRAY :
716- DEFAULT_PROPERTIES . BUFFER ;
715+ defaultProperties . ARRAY :
716+ defaultProperties . BUFFER ;
717717 }
718718 return Object . getOwnPropertyNames ( obj ) . filter ( intFilter ) ;
719719}
@@ -756,7 +756,6 @@ function complete(line, callback) {
756756 }
757757 }
758758
759- var self = this ;
760759 var completions ;
761760
762761 // list of completion lists, one for each inheritance "level"
@@ -892,13 +891,13 @@ function complete(line, callback) {
892891 }
893892 } else {
894893 const evalExpr = `try { ${ expr } } catch (e) {}` ;
895- this . eval ( evalExpr , this . context , 'repl' , function doEval ( e , obj ) {
894+ this . eval ( evalExpr , this . context , 'repl' , ( e , obj ) => {
896895 // if (e) console.log(e);
897896
898897 if ( obj != null ) {
899898 if ( typeof obj === 'object' || typeof obj === 'function' ) {
900899 try {
901- memberGroups . push ( filteredOwnPropertyNames . call ( self , obj ) ) ;
900+ memberGroups . push ( filteredOwnPropertyNames . call ( this , obj ) ) ;
902901 } catch ( ex ) {
903902 // Probably a Proxy object without `getOwnPropertyNames` trap.
904903 // We simply ignore it here, as we don't want to break the
@@ -916,7 +915,7 @@ function complete(line, callback) {
916915 p = obj . constructor ? obj . constructor . prototype : null ;
917916 }
918917 while ( p !== null ) {
919- memberGroups . push ( filteredOwnPropertyNames . call ( self , p ) ) ;
918+ memberGroups . push ( filteredOwnPropertyNames . call ( this , p ) ) ;
920919 p = Object . getPrototypeOf ( p ) ;
921920 // Circular refs possible? Let's guard against that.
922921 sentinel -- ;
0 commit comments