From 87d88319cc3586a8f2c57be508c83427d86fabe5 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Fri, 11 Oct 2013 14:26:13 -0700 Subject: [PATCH] Backout 6de71ba24d50 (bug 922835) because it was the wrong version of the patch. r=me --- toolkit/devtools/server/actors/script.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/toolkit/devtools/server/actors/script.js b/toolkit/devtools/server/actors/script.js index 8091efb7f17..5d1e30b4108 100644 --- a/toolkit/devtools/server/actors/script.js +++ b/toolkit/devtools/server/actors/script.js @@ -467,13 +467,6 @@ ThreadActor.prototype = { return this._sources; }, - get youngestFrame() { - if (!this.state == "paused") { - return null; - } - return this.dbg.getNewestFrame(); - }, - _prettyPrintWorker: null, get prettyPrintWorker() { if (!this._prettyPrintWorker) { @@ -1186,6 +1179,10 @@ ThreadActor.prototype = { 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. @@ -1741,6 +1738,10 @@ ThreadActor.prototype = { 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"); @@ -4023,7 +4024,7 @@ function getOffsetColumn(aOffset, aScript) { * Returns an object of the form { url, line, column } */ function getFrameLocation(aFrame) { - if (!aFrame || !aFrame.script) { + if (!aFrame.script) { return { url: null, line: null, column: null }; } return {