summaryrefslogtreecommitdiff
path: root/lib/readline.js
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2019-07-11 09:52:25 -0400
committercjihrig <cjihrig@gmail.com>2019-07-13 10:26:06 -0400
commit223ba43434ef4faad6d199d2e620ece30c278fa9 (patch)
tree7c19b6aa682f0d26d6b34863ed9b581d3d94ed58 /lib/readline.js
parent5af9f15fd8a2a8038f5f18fa4aa6d2c8344813ee (diff)
downloadandroid-node-v8-223ba43434ef4faad6d199d2e620ece30c278fa9.tar.gz
android-node-v8-223ba43434ef4faad6d199d2e620ece30c278fa9.tar.bz2
android-node-v8-223ba43434ef4faad6d199d2e620ece30c278fa9.zip
readline: remove IIFE in SIGCONT handler
This commit removes an IIFE in the readline SIGCONT handler that was previously being used to bind `this`. PR-URL: https://github.com/nodejs/node/pull/28639 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Diffstat (limited to 'lib/readline.js')
-rw-r--r--lib/readline.js30
1 files changed, 14 insertions, 16 deletions
diff --git a/lib/readline.js b/lib/readline.js
index 29031e263e..958370348d 100644
--- a/lib/readline.js
+++ b/lib/readline.js
@@ -939,22 +939,20 @@ Interface.prototype._ttyWrite = function(s, key) {
if (this.listenerCount('SIGTSTP') > 0) {
this.emit('SIGTSTP');
} else {
- process.once('SIGCONT', (function continueProcess(self) {
- return function() {
- // Don't raise events if stream has already been abandoned.
- if (!self.paused) {
- // Stream must be paused and resumed after SIGCONT to catch
- // SIGINT, SIGTSTP, and EOF.
- self.pause();
- self.emit('SIGCONT');
- }
- // Explicitly re-enable "raw mode" and move the cursor to
- // the correct position.
- // See https://github.com/joyent/node/issues/3295.
- self._setRawMode(true);
- self._refreshLine();
- };
- })(this));
+ process.once('SIGCONT', () => {
+ // Don't raise events if stream has already been abandoned.
+ if (!this.paused) {
+ // Stream must be paused and resumed after SIGCONT to catch
+ // SIGINT, SIGTSTP, and EOF.
+ this.pause();
+ this.emit('SIGCONT');
+ }
+ // Explicitly re-enable "raw mode" and move the cursor to
+ // the correct position.
+ // See https://github.com/joyent/node/issues/3295.
+ this._setRawMode(true);
+ this._refreshLine();
+ });
this._setRawMode(false);
process.kill(process.pid, 'SIGTSTP');
}