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>
v6
Brian White 8 years ago
parent
commit
4484e8f7e2
No known key found for this signature in database GPG Key ID: 606D7358F94DA209
  1. 4
      lib/readline.js

4
lib/readline.js

@ -470,8 +470,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