micro-refactor, use rli.output.write instead of rli.write ('line' event was emitted for those writes)

pull/22966/head
Fedor Indutny 2011-09-20 17:04:35 +07:00 committed by Ryan Dahl
parent 292e2ea5ad
commit 41a41825f6
1 changed files with 8 additions and 6 deletions

View File

@ -124,17 +124,19 @@ function REPLServer(prompt, stream, eval) {
rli.close();
process.exit();
}
var bareInt = false;
rli.line = '';
if (!(self.bufferedCommand && self.bufferedCommand.length > 0) &&
rli.line.length === 0) {
rli.write('\n(^C again to quit)');
bareInt = true;
rli.output.write('\n(^C again to quit)\n');
sawSIGINT = true;
} else {
rli.output.write('\n');
}
rli.line = '';
rli.write('\n');
self.bufferedCommand = '';
self.displayPrompt();
sawSIGINT = bareInt;
});
rli.addListener('line', function(cmd) {