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 @@ -366,6 +366,9 @@ function* emitKeys(stream) {
366366
367367// This runs in O(n log n).
368368function commonPrefix ( strings ) {
369+ if ( strings . length === 0 ) {
370+ return '' ;
371+ }
369372 if ( strings . length === 1 ) {
370373 return strings [ 0 ] ;
371374 }
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