Browse Source

Fix #2034 repl message for .clear when useGlobal=true

v0.7.4-release
isaacs 14 years ago
committed by Ben Noordhuis
parent
commit
8e57398b20
  1. 14
      lib/repl.js

14
lib/repl.js

@ -712,12 +712,20 @@ function defineDefaultCommands(repl) {
} }
}); });
var clearMessage;
if (repl.useGlobal) {
clearMessage = 'Alias for .break';
} else {
clearMessage = 'Break, and also clear the local context';
}
repl.defineCommand('clear', { repl.defineCommand('clear', {
help: 'Break, and also clear the local context', help: clearMessage,
action: function() { action: function() {
this.outputStream.write('Clearing context...\n');
this.bufferedCommand = ''; this.bufferedCommand = '';
this.resetContext(true); if (!this.useGlobal) {
this.outputStream.write('Clearing context...\n');
this.resetContext(true);
}
this.displayPrompt(); this.displayPrompt();
} }
}); });

Loading…
Cancel
Save