Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Fix #2034 repl message for .clear when useGlobal=true
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs authored and bnoordhuis committed Dec 31, 2011
1 parent 539598b commit 8e57398
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/repl.js
Expand Up @@ -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', {
help: 'Break, and also clear the local context',
help: clearMessage,
action: function() {
this.outputStream.write('Clearing context...\n');
this.bufferedCommand = '';
this.resetContext(true);
if (!this.useGlobal) {
this.outputStream.write('Clearing context...\n');
this.resetContext(true);
}
this.displayPrompt();
}
});
Expand Down

0 comments on commit 8e57398

Please sign in to comment.