Browse Source

[debugger] separate history of control and debug, make scripts command getter

Fedor Indutny 13 years ago
parent
commit
1dd3b68c4f
  1. 20
      lib/_debugger.js

20
lib/_debugger.js

@ -735,6 +735,10 @@ function Interface() {
this.waiting = null;
this.paused = 0;
this.context = this.repl.context;
this.history = {
debug: [],
control: []
};
};
@ -1015,11 +1019,12 @@ Interface.prototype.backtrace = function() {
// 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) {
@ -1228,6 +1233,10 @@ Interface.prototype.repl = function() {
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();
@ -1236,8 +1245,13 @@ Interface.prototype.repl = function() {
// 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> ');

Loading…
Cancel
Save