Skip to content

Commit

Permalink
readline: revert semver-major of 28109
Browse files Browse the repository at this point in the history
PR-URL: nodejs#28109
  • Loading branch information
sam-github committed Jun 10, 2019
1 parent 006cda5 commit f832e86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/readline.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function Interface(input, output, completer, terminal) {
input = input.input;
}

if (completer !== undefined && typeof completer !== 'function') {
if (completer && typeof completer !== 'function') {
throw new ERR_INVALID_OPT_VALUE('completer', completer);
}

Expand Down
14 changes: 4 additions & 10 deletions test/parallel/test-readline-interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,25 +367,19 @@ function isWarned(emitter) {
code: 'ERR_INVALID_OPT_VALUE'
});

common.expectsError(function() {
common.mustCall(function() {
readline.createInterface({
input: fi,
completer: ''
});
}, {
type: TypeError,
code: 'ERR_INVALID_OPT_VALUE'
});
})();

common.expectsError(function() {
common.mustCall(function() {
readline.createInterface({
input: fi,
completer: false
});
}, {
type: TypeError,
code: 'ERR_INVALID_OPT_VALUE'
});
})();
}

// Constructor throws if historySize is not a positive number
Expand Down

0 comments on commit f832e86

Please sign in to comment.