Skip to content

Commit f832e86

Browse files
committed
readline: revert semver-major of 28109
PR-URL: nodejs#28109
1 parent 006cda5 commit f832e86

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

lib/readline.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function Interface(input, output, completer, terminal) {
121121
input = input.input;
122122
}
123123

124-
if (completer !== undefined && typeof completer !== 'function') {
124+
if (completer && typeof completer !== 'function') {
125125
throw new ERR_INVALID_OPT_VALUE('completer', completer);
126126
}
127127

test/parallel/test-readline-interface.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -367,25 +367,19 @@ function isWarned(emitter) {
367367
code: 'ERR_INVALID_OPT_VALUE'
368368
});
369369

370-
common.expectsError(function() {
370+
common.mustCall(function() {
371371
readline.createInterface({
372372
input: fi,
373373
completer: ''
374374
});
375-
}, {
376-
type: TypeError,
377-
code: 'ERR_INVALID_OPT_VALUE'
378-
});
375+
})();
379376

380-
common.expectsError(function() {
377+
common.mustCall(function() {
381378
readline.createInterface({
382379
input: fi,
383380
completer: false
384381
});
385-
}, {
386-
type: TypeError,
387-
code: 'ERR_INVALID_OPT_VALUE'
388-
});
382+
})();
389383
}
390384

391385
// Constructor throws if historySize is not a positive number

0 commit comments

Comments
 (0)