Skip to content

Commit

Permalink
readline: refactor Interface to ES2015 class
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Apr 27, 2021
1 parent 25e7125 commit 56143e4
Show file tree
Hide file tree
Showing 4 changed files with 1,469 additions and 1,272 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 56143e4

Please sign in to comment.