Bug 785044 - Replace the ThreadActor's private debugger object and its getter with a public property. r=past

This commit is contained in:
Anton Kovalyov 2012-09-20 14:15:15 -07:00
parent 5287bb665f
commit 903bd6fd23

View File

@ -40,8 +40,6 @@ ThreadActor.prototype = {
get state() { return this._state; },
get dbg() { return this._dbg; },
get _breakpointStore() { return ThreadActor._breakpointStore; },
get threadLifetimePool() {
@ -53,10 +51,10 @@ ThreadActor.prototype = {
},
clearDebuggees: function TA_clearDebuggees() {
if (this._dbg) {
let debuggees = this._dbg.getDebuggees();
if (this.dbg) {
let debuggees = this.dbg.getDebuggees();
for (let debuggee of debuggees) {
this._dbg.removeDebuggee(debuggee);
this.dbg.removeDebuggee(debuggee);
}
}
this.conn.removeActorPool(this._threadLifetimePool || undefined);
@ -79,11 +77,11 @@ ThreadActor.prototype = {
// medium- to long-term, and will be managed by the engine
// instead.
if (!this._dbg) {
this._dbg = new Debugger();
this._dbg.uncaughtExceptionHook = this.uncaughtExceptionHook.bind(this);
this._dbg.onDebuggerStatement = this.onDebuggerStatement.bind(this);
this._dbg.onNewScript = this.onNewScript.bind(this);
if (!this.dbg) {
this.dbg = new Debugger();
this.dbg.uncaughtExceptionHook = this.uncaughtExceptionHook.bind(this);
this.dbg.onDebuggerStatement = this.onDebuggerStatement.bind(this);
this.dbg.onNewScript = this.onNewScript.bind(this);
// Keep the debugger disabled until a client attaches.
this.dbg.enabled = this._state != "detached";
}
@ -115,11 +113,11 @@ ThreadActor.prototype = {
this.clearDebuggees();
if (!this._dbg) {
if (!this.dbg) {
return;
}
this._dbg.enabled = false;
this._dbg = null;
this.dbg.enabled = false;
this.dbg = null;
},
/**