mirror of https://github.com/nodejs/node.git
micro-refactor, use rli.output.write instead of rli.write ('line' event was emitted for those writes)
parent
292e2ea5ad
commit
41a41825f6
14
lib/repl.js
14
lib/repl.js
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue