File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -365,6 +365,9 @@ function* emitKeys(stream) {
365365
366366// This runs in O(n log n).
367367function commonPrefix ( strings ) {
368+ if ( strings . length === 0 ) {
369+ return '' ;
370+ }
368371 if ( strings . length === 1 ) {
369372 return strings [ 0 ] ;
370373 }
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ require ( '../common' ) ;
4+ const ArrayStream = require ( '../common/arraystream' ) ;
5+ const repl = require ( 'repl' ) ;
6+
7+ const stream = new ArrayStream ( ) ;
8+ const replServer = repl . start ( {
9+ input : stream ,
10+ output : stream ,
11+ terminal : true ,
12+ } ) ;
13+
14+ // Editor mode
15+ replServer . write ( '.editor\n' ) ;
16+
17+ // Regression test for https://github.com/nodejs/node/issues/43528
18+ replServer . write ( 'a' ) ;
19+ replServer . write ( null , { name : 'tab' } ) ; // Should not throw
20+
21+ replServer . close ( ) ;
You can’t perform that action at this time.
0 commit comments