Browse Source

readline: fix permanent deoptimizations

PR-URL: https://github.com/nodejs/node/pull/12456
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
v7.x
Brian White 8 years ago
committed by Evan Lucas
parent
commit
1ac331b29f
  1. 4
      lib/readline.js

4
lib/readline.js

@ -449,8 +449,8 @@ Interface.prototype._tabComplete = function(lastKeypressWasTab) {
}
// If there is a common prefix to all matches, then apply that portion.
const f = completions.filter(function(e) { if (e) return e; });
const prefix = commonPrefix(f);
var f = completions.filter(function(e) { if (e) return e; });
var prefix = commonPrefix(f);
if (prefix.length > completeOn.length) {
self._insertString(prefix.slice(completeOn.length));
}

Loading…
Cancel
Save