this.waiting = null;
this.paused = 0;
this.context = this.repl.context;
+ this.history = {
+ debug: [],
+ control: []
+ };
};
// argument full tells if it should display internal node scripts or not
-Interface.prototype.scripts = function(displayNatives) {
+Interface.prototype.scripts = function() {
if (!this.requireConnection()) return;
- var client = this.client;
- var scripts = [];
+ var client = this.client,
+ displayNatives = arguments[0] || false,
+ scripts = [];
this.pause();
for (var id in client.scripts) {
this.repl.eval = this.debugEval.bind(this);
this.repl.context = {};
+ // Swap history
+ this.history.control = this.repl.rli.history;
+ this.repl.rli.history = this.history.debug;
+
this.repl.prompt = '> ';
this.repl.rli.setPrompt('> ');
this.repl.displayPrompt();
// Exit debug repl
Interface.prototype.exitRepl = function() {
+ // Restore eval
this.repl.eval = this.controlEval.bind(this);
+ // Swap history
+ this.history.debug = this.repl.rli.history;
+ this.repl.rli.history = this.history.control;
+
this.repl.context = this.context;
this.repl.prompt = 'debug> ';
this.repl.rli.setPrompt('debug> ');