From 99b210d7eaca6d0bf8731b338ce0a32d9df1e493 Mon Sep 17 00:00:00 2001 From: Yoshihiro KIKUCHI Date: Thu, 30 Jun 2011 22:20:23 +0900 Subject: [PATCH] tiny fixes in tty_posix.js Close #1158 Close #1160 Close #1252 --- lib/tty_posix.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/tty_posix.js b/lib/tty_posix.js index a114d7cba2c..67d0d91075b 100644 --- a/lib/tty_posix.js +++ b/lib/tty_posix.js @@ -71,14 +71,14 @@ function ReadStream(fd) { } else { // Nobody's watching anyway self.removeListener('data', onData); - self.on('newlistener', onNewListener); + self.on('newListener', onNewListener); } } function onNewListener(event) { if (event == 'keypress') { self.on('data', onData); - self.removeListener('newlistener', onNewListener); + self.removeListener('newListener', onNewListener); } } @@ -331,7 +331,7 @@ WriteStream.prototype.cursorTo = function(x, y) { if (typeof x !== 'number') throw new Error("Can't set cursor row without also setting it's column"); - if (typeof x === 'number') { + if (typeof y !== 'number') { this.write('\x1b[' + (x + 1) + 'G'); } else { this.write('\x1b[' + (y + 1) + ';' + (x + 1) + 'H');