Skip to content

Commit dc73403

Browse files
cjihrigtargos
authored andcommitted
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: #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>
1 parent e0c5e7a commit dc73403

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

lib/readline.js

+14-16
Original file line numberDiff line numberDiff line change
@@ -939,22 +939,20 @@ Interface.prototype._ttyWrite = function(s, key) {
939939
if (this.listenerCount('SIGTSTP') > 0) {
940940
this.emit('SIGTSTP');
941941
} else {
942-
process.once('SIGCONT', (function continueProcess(self) {
943-
return function() {
944-
// Don't raise events if stream has already been abandoned.
945-
if (!self.paused) {
946-
// Stream must be paused and resumed after SIGCONT to catch
947-
// SIGINT, SIGTSTP, and EOF.
948-
self.pause();
949-
self.emit('SIGCONT');
950-
}
951-
// Explicitly re-enable "raw mode" and move the cursor to
952-
// the correct position.
953-
// See https://github.com/joyent/node/issues/3295.
954-
self._setRawMode(true);
955-
self._refreshLine();
956-
};
957-
})(this));
942+
process.once('SIGCONT', () => {
943+
// Don't raise events if stream has already been abandoned.
944+
if (!this.paused) {
945+
// Stream must be paused and resumed after SIGCONT to catch
946+
// SIGINT, SIGTSTP, and EOF.
947+
this.pause();
948+
this.emit('SIGCONT');
949+
}
950+
// Explicitly re-enable "raw mode" and move the cursor to
951+
// the correct position.
952+
// See https://github.com/joyent/node/issues/3295.
953+
this._setRawMode(true);
954+
this._refreshLine();
955+
});
958956
this._setRawMode(false);
959957
process.kill(process.pid, 'SIGTSTP');
960958
}

0 commit comments

Comments
 (0)