From 0b61cd5ecf5e17fc96c67ce49987cda73e9a5583 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 22 May 2015 18:28:12 -0700 Subject: [PATCH] readline: simplify condition, accept any falsy value for undefined --- lib/readline.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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'); }