fix property name collision if input/output is a socket.

This commit is contained in:
Christopher Jeffrey 2015-07-30 18:17:58 -07:00
parent fe1f470995
commit 3ff6c4e5fb
1 changed files with 10 additions and 10 deletions

View File

@ -314,11 +314,11 @@ Program.prototype.listen = function() {
// }
// Listen for keys/mouse on input
if (!this.input._blessedListened) {
this.input._blessedListened = 1;
if (!this.input._blessedInput) {
this.input._blessedInput = 1;
this._listenInput();
} else {
this.input._blessedListened++;
this.input._blessedInput++;
}
this.on('newListener', this._newHandler = function fn(type) {
@ -339,11 +339,11 @@ Program.prototype.listen = function() {
});
// Listen for resize on output
if (!this.output._blessedListened) {
this.output._blessedListened = 1;
if (!this.output._blessedOutput) {
this.output._blessedOutput = 1;
this._listenOutput();
} else {
this.output._blessedListened++;
this.output._blessedOutput++;
}
};
@ -454,10 +454,10 @@ Program.prototype.destroy = function() {
delete Program._bound;
}
this.input._blessedListened--;
this.output._blessedListened--;
this.input._blessedInput--;
this.output._blessedOutput--;
if (this.input._blessedListened === 0) {
if (this.input._blessedInput === 0) {
this.input.removeListener('keypress', this.input._keypressHandler);
this.input.removeListener('data', this.input._dataHandler);
delete this.input._keypressHandler;
@ -473,7 +473,7 @@ Program.prototype.destroy = function() {
}
}
if (this.output._blessedListened === 0) {
if (this.output._blessedOutput === 0) {
this.output.removeListener('resize', this.output._resizeHandler);
delete this.output._resizeHandler;
}