diff --git a/lib/readline.js b/lib/readline.js index 75eb7fe08d1..d69aeb4a882 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -839,7 +839,7 @@ var functionKeyCodeRe = /^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/; function emitKey(stream, s) { - var char, + var ch, key = { name: undefined, ctrl: false, @@ -1029,11 +1029,11 @@ function emitKey(stream, s) { } if (s.length === 1) { - char = s; + ch = s; } - if (key || char) { - stream.emit('keypress', char, key); + if (key || ch) { + stream.emit('keypress', ch, key); } }