diff options
Diffstat (limited to 'lib/repl.js')
-rw-r--r-- | lib/repl.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/repl.js b/lib/repl.js index 3b95bd7f29..3368b5997a 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -298,6 +298,7 @@ function REPLServer(prompt, configurable: true }); + this.allowBlockingCompletions = !!options.allowBlockingCompletions; this.useColors = !!options.useColors; this._domain = options.domain || domain.create(); this.useGlobal = !!useGlobal; @@ -1204,7 +1205,8 @@ function complete(line, callback) { if (completeOn.length) { filter = completeOn; } - } else if (RegExpPrototypeTest(requireRE, line)) { + } else if (RegExpPrototypeTest(requireRE, line) && + this.allowBlockingCompletions) { // require('...<Tab>') const extensions = ObjectKeys(this.context.require.extensions); const indexes = ArrayPrototypeMap(extensions, @@ -1265,7 +1267,8 @@ function complete(line, callback) { if (!subdir) { ArrayPrototypePush(completionGroups, _builtinLibs); } - } else if (RegExpPrototypeTest(fsAutoCompleteRE, line)) { + } else if (RegExpPrototypeTest(fsAutoCompleteRE, line) && + this.allowBlockingCompletions) { [completionGroups, completeOn] = completeFSFunctions(line); // Handle variable member lookup. // We support simple chained expressions like the following (no function |