Skip to content

Commit

Permalink
readline: refactor Interface to ES2015 class
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
aduh95 committed Sep 16, 2021
1 parent 0f1765e commit 592d1c3
Show file tree
Hide file tree
Showing 3 changed files with 1,551 additions and 1,155 deletions.
5 changes: 4 additions & 1 deletion lib/internal/readline/emitKeypressEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ const {
CSI,
emitKeys,
} = require('internal/readline/utils');
const {
kSawKeyPress,
} = require('internal/readline/interface');

const { clearTimeout, setTimeout } = require('timers');
const {
Expand Down Expand Up @@ -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;
Expand Down
Loading

0 comments on commit 592d1c3

Please sign in to comment.