Bug 916458 - Ignore failures to get the lastPausedUrl when a tab is closing. r=fitzgen, a=akeybl
--- a/toolkit/devtools/server/actors/script.js
+++ b/toolkit/devtools/server/actors/script.js
@@ -283,19 +283,27 @@ EventLoopStack.prototype = {
get size() {
return this._inspector.eventLoopNestLevel;
},
/**
* The URL of the debuggee who pushed the event loop on top of the stack.
*/
get lastPausedUrl() {
- return this.size > 0
- ? this._inspector.lastNestRequestor.url
- : null;
+ let url = null;
+ if (this.size > 0) {
+ try {
+ url = this._inspector.lastNestRequestor.url
+ } catch (e) {
+ // The tab's URL getter may throw if the tab is destroyed by the time
+ // this code runs, but we don't really care at this point.
+ dumpn(e);
+ }
+ }
+ return url;
},
/**
* Push a new nested event loop onto the stack.
*
* @returns EventLoop
*/
push: function () {
@@ -726,17 +734,17 @@ ThreadActor.prototype = {
message: "Can't resume when debuggee isn't paused. Current state is '"
+ this._state + "'"
};
}
// In case of multiple nested event loops (due to multiple debuggers open in
// different tabs or multiple debugger clients connected to the same tab)
// only allow resumption in a LIFO order.
- if (this._nestedEventLoops.size
+ if (this._nestedEventLoops.size && this._nestedEventLoops.lastPausedUrl
&& this._nestedEventLoops.lastPausedUrl !== this._hooks.url) {
return {
error: "wrongOrder",
message: "trying to resume in the wrong order.",
lastPausedUrl: this._nestedEventLoops.lastPausedUrl
};
}