readline: refactor Interface to ES2015 class

PR-URL: https://github.com/nodejs/node/pull/37947
Fixes: https://github.com/nodejs/node/issues/37287
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
This commit is contained in:
Antoine du Hamel 2021-04-27 16:13:38 +02:00
parent 0f1765e134
commit 592d1c3d44
3 changed files with 1572 additions and 1176 deletions

View File

@ -10,6 +10,9 @@ const {
CSI,
emitKeys,
} = require('internal/readline/utils');
const {
kSawKeyPress,
} = require('internal/readline/interface');
const { clearTimeout, setTimeout } = require('timers');
const {
@ -47,7 +50,7 @@ function emitKeypressEvents(stream, iface = {}) {
clearTimeout(timeoutId);
// This supports characters of length 2.
iface._sawKeyPress = charLengthAt(string, 0) === string.length;
iface[kSawKeyPress] = charLengthAt(string, 0) === string.length;
iface.isCompletionEnabled = false;
let length = 0;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff