author | Nick Fitzgerald <fitzgen@gmail.com> |
Fri, 11 Oct 2013 14:35:51 -0700 | |
changeset 150518 | c5235838989731c07bc4781507cafda90c6a8b1a |
parent 150517 | 71d3897f3ba8b029e0b65b588d3e4ebf395bb011 |
child 150547 | 73f37c7a386094cfb79205529ef72ba1966509f4 |
child 150572 | f22b6a8bc244d4f19fb07b07b74e8148384ae043 |
push id | 25445 |
push user | kwierso@gmail.com |
push date | Sat, 12 Oct 2013 01:38:49 +0000 |
treeherder | mozilla-central@c52358389897 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | past |
bugs | 922835 |
milestone | 27.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/toolkit/devtools/server/actors/script.js +++ b/toolkit/devtools/server/actors/script.js @@ -462,16 +462,23 @@ ThreadActor.prototype = { get sources() { if (!this._sources) { this._sources = new ThreadSources(this, this._options.useSourceMaps, this._allowSource, this.onNewSource); } return this._sources; }, + get youngestFrame() { + if (!this.state == "paused") { + return null; + } + return this.dbg.getNewestFrame(); + }, + _prettyPrintWorker: null, get prettyPrintWorker() { if (!this._prettyPrintWorker) { this._prettyPrintWorker = new ChromeWorker( "resource://gre/modules/devtools/server/actors/pretty-print-worker.js"); this._prettyPrintWorker.addEventListener( "error", this._onPrettyPrintError, false); @@ -1174,20 +1181,16 @@ ThreadActor.prototype = { message: "Evaluation frame not found" }; } if (!frame.environment) { return { error: "notDebuggee", message: "cannot access the environment of this frame." }; } - // We'll clobber the youngest frame if the eval causes a pause, so - // save our frame now to be restored after eval returns. - // XXX: or we could just start using dbg.getNewestFrame() now that it - // works as expected. let youngest = this.youngestFrame; // Put ourselves back in the running state and inform the client. let resumedPacket = this._resumed(); this.conn.send(resumedPacket); // Run the expression. // XXX: test syntax errors @@ -1733,20 +1736,16 @@ ThreadActor.prototype = { for (let [,bp] of this._hiddenBreakpoints) { bp.onDelete(); } this._hiddenBreakpoints.clear(); } this._state = "paused"; - // Save the pause frame (if any) as the youngest frame for - // stack viewing. - this.youngestFrame = aFrame; - // Create the actor pool that will hold the pause actor and its // children. dbg_assert(!this._pausePool, "No pause pool should exist yet"); this._pausePool = new ActorPool(this.conn); this.conn.addActorPool(this._pausePool); // Give children of the pause pool a quick link back to the // thread... @@ -1778,17 +1777,16 @@ ThreadActor.prototype = { _resumed: function TA_resumed() { this._state = "running"; // Drop the actors in the pause actor pool. this.conn.removeActorPool(this._pausePool); this._pausePool = null; this._pauseActor = null; - this.youngestFrame = null; return { from: this.actorID, type: "resumed" }; }, /** * Expire frame actors for frames that have been popped. * * @returns A list of actor IDs whose frames have been popped. @@ -4019,17 +4017,17 @@ function getOffsetColumn(aOffset, aScrip * frame does not have a script, the location's properties are all null. * * @param Debugger.Frame aFrame * The frame whose location we are getting. * @returns Object * Returns an object of the form { url, line, column } */ function getFrameLocation(aFrame) { - if (!aFrame.script) { + if (!aFrame || !aFrame.script) { return { url: null, line: null, column: null }; } return { url: aFrame.script.url, line: aFrame.script.getOffsetLine(aFrame.offset), column: getOffsetColumn(aFrame.offset, aFrame.script) } }