Browse Source

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

This fixes the failing REPL tests.
v0.9.1-release
Nathan Rajlich 13 years ago
parent
commit
327286dbcd
  1. 8
      lib/repl.js

8
lib/repl.js

@ -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();
}
});

Loading…
Cancel
Save