| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b17a70f commit 04633ee
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -121,7 +121,7 @@ function Interface(input, output, completer, terminal) { | |||
| 121 | 121 | input = input.input; | |
| 122 | 122 | } | |
| 123 | 123 | ||
| 124 | - if (completer && typeof completer !== 'function') { | ||
| 124 | + if (completer !== undefined && typeof completer !== 'function') { | ||
| 125 | 125 | throw new ERR_INVALID_OPT_VALUE('completer', completer); | |
| 126 | 126 | } | |
| 127 | 127 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -366,6 +366,26 @@ function isWarned(emitter) { | |||
| 366 | 366 | type: TypeError, | |
| 367 | 367 | code: 'ERR_INVALID_OPT_VALUE' | |
| 368 | 368 | }); | |
| 369 | + | ||
| 370 | + common.expectsError(function() { | ||
| 371 | + readline.createInterface({ | ||
| 372 | + input: fi, | ||
| 373 | + completer: '' | ||
| 374 | + }); | ||
| 375 | + }, { | ||
| 376 | + type: TypeError, | ||
| 377 | + code: 'ERR_INVALID_OPT_VALUE' | ||
| 378 | + }); | ||
| 379 | + | ||
| 380 | + common.expectsError(function() { | ||
| 381 | + readline.createInterface({ | ||
| 382 | + input: fi, | ||
| 383 | + completer: false | ||
| 384 | + }); | ||
| 385 | + }, { | ||
| 386 | + type: TypeError, | ||
| 387 | + code: 'ERR_INVALID_OPT_VALUE' | ||
| 388 | + }); | ||
| 369 | 389 | } | |
| 370 | 390 | ||
| 371 | 391 | // Constructor throws if historySize is not a positive number | |
| Back | FazBrowse Home | New Git URL |
0 commit comments