diff --git a/lib/readline.js b/lib/readline.js index dc1cf977a38c3c..2cdd2cf392c71f 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -47,9 +47,7 @@ function Interface(input, output, completer, terminal) { } historySize = historySize || kHistorySize; - completer = completer || undefined; - - if (typeof completer !== 'function' && typeof completer !== 'undefined') { + if (completer && typeof completer !== 'function') { throw new TypeError('Argument \'completer\' must be a function'); }