File tree 2 files changed +24
-0
lines changed
2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -365,6 +365,9 @@ function* emitKeys(stream) {
365
365
366
366
// This runs in O(n log n).
367
367
function commonPrefix ( strings ) {
368
+ if ( strings . length === 0 ) {
369
+ return '' ;
370
+ }
368
371
if ( strings . length === 1 ) {
369
372
return strings [ 0 ] ;
370
373
}
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