Skip to content

Commit 592d1c3

Browse files
committed
readline: refactor Interface to ES2015 class
PR-URL: #37947 Fixes: #37287 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com>
1 parent 0f1765e commit 592d1c3

File tree

3 files changed

+1551
-1155
lines changed

3 files changed

+1551
-1155
lines changed

lib/internal/readline/emitKeypressEvents.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ const {
1010
CSI,
1111
emitKeys,
1212
} = require('internal/readline/utils');
13+
const {
14+
kSawKeyPress,
15+
} = require('internal/readline/interface');
1316

1417
const { clearTimeout, setTimeout } = require('timers');
1518
const {
@@ -47,7 +50,7 @@ function emitKeypressEvents(stream, iface = {}) {
4750
clearTimeout(timeoutId);
4851

4952
// This supports characters of length 2.
50-
iface._sawKeyPress = charLengthAt(string, 0) === string.length;
53+
iface[kSawKeyPress] = charLengthAt(string, 0) === string.length;
5154
iface.isCompletionEnabled = false;
5255

5356
let length = 0;

0 commit comments

Comments
 (0)