mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
readline: remove question method from InterfaceConstructor
That method is overwritten in both
`require('node:readline').Interface.prototype` and
`require('node:readline/promises').Interface.prototype`, and is very
much not useful outside of interacting with TTY, removing it from the
parent class could enable the use of `InterfaceConstructor` in other
contexts (such as interacting with files).
PR-URL: https://github.com/nodejs/node/pull/44606
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
@@ -10,6 +10,7 @@ const {
|
||||
|
||||
const {
|
||||
Interface: _Interface,
|
||||
kQuestion,
|
||||
kQuestionCancel,
|
||||
} = require('internal/readline/interface');
|
||||
|
||||
@@ -49,7 +50,7 @@ class Interface extends _Interface {
|
||||
};
|
||||
}
|
||||
|
||||
super.question(query, cb);
|
||||
this[kQuestion](query, cb);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user