Permalink
Browse files

repl: update the `repl` for the new `readline` behavior

This fixes the failing REPL tests.
  • Loading branch information...
1 parent c5d35ac commit 327286dbcdd91b9a6c983cdf307e36ac36acf05d @TooTallNate TooTallNate committed Apr 17, 2012
Showing with 3 additions and 5 deletions.
  1. +3 −5 lib/repl.js
View
@@ -175,7 +175,7 @@ function REPLServer(prompt, stream, eval, useGlobal, ignoreUndefined) {
rli.setPrompt(self.prompt);
- rli.on('end', function() {
+ rli.on('close', function() {
self.emit('exit');
});
@@ -186,8 +186,7 @@ function REPLServer(prompt, stream, eval, useGlobal, ignoreUndefined) {
if (!(self.bufferedCommand && self.bufferedCommand.length > 0) && empty) {
if (sawSIGINT) {
- rli.pause();
- self.emit('exit');
+ rli.close();
sawSIGINT = false;
return;
}
@@ -807,8 +806,7 @@ function defineDefaultCommands(repl) {
repl.defineCommand('exit', {
help: 'Exit the repl',
action: function() {
- this.rli.pause();
- this.emit('exit');
+ this.rli.close();
}
});

0 comments on commit 327286d

Please sign in to comment.