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