From 3ff6c4e5fb62c3502c943b69940a8a2bedcda01d Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Thu, 30 Jul 2015 18:17:58 -0700 Subject: [PATCH] fix property name collision if input/output is a socket. --- lib/program.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/program.js b/lib/program.js index 79730a7..3a657c2 100644 --- a/lib/program.js +++ b/lib/program.js @@ -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; }