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:
parent
0f1765e134
commit
592d1c3d44
@ -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;
|
||||
|
1261
lib/internal/readline/interface.js
Normal file
1261
lib/internal/readline/interface.js
Normal file
File diff suppressed because it is too large
Load Diff
1482
lib/readline.js
1482
lib/readline.js
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user