Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[readline] completer should be optional

  • Loading branch information...
commit 79273a0cd9a407d567bac7fbcecc5c61d4ab73a1 1 parent 70a5659
@indutny authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/readline.js
View
10 lib/readline.js
@@ -51,10 +51,12 @@ function Interface(input, output, completer) {
this.input = input;
input.resume();
- // Check arity, 2 - for async, 1 for sync
- this.completer = completer.length === 2 ? completer : function(v, callback) {
- callback(null, completer(v));
- };
+ if (completer) {
+ // Check arity, 2 - for async, 1 for sync
+ this.completer = completer.length === 2 ? completer : function(v, callback) {
+ callback(null, completer(v));
+ };
+ }
this.setPrompt('> ');
Please sign in to comment.
Something went wrong with that request. Please try again.