Bug 754985: Move DebuggerServer._checkInit near the other initialization code. r=dcamp
try: -b do -p all -u xpcshell,mochitest-dt -t none
--- a/toolkit/devtools/server/main.js
+++ b/toolkit/devtools/server/main.js
@@ -220,16 +220,29 @@ var DebuggerServer = {
this.tabActorFactories = {};
this._transportInitialized = false;
this._initialized = false;
dumpn("Debugger server is shut down.");
},
/**
+ * Raises an exception if the server has not been properly initialized.
+ */
+ _checkInit: function DS_checkInit() {
+ if (!this._transportInitialized) {
+ throw "DebuggerServer has not been initialized.";
+ }
+
+ if (!this.createRootActor) {
+ throw "Use DebuggerServer.addActors() to add a root actor implementation.";
+ }
+ },
+
+ /**
* Load a subscript into the debugging global.
*
* @param aURL string A url that will be loaded as a subscript into the
* debugging global. The user must load at least one script
* that implements a createRootActor() function to create the
* server's root actor.
*/
addActors: function DS_addActors(aURL) {
@@ -925,29 +938,16 @@ var DebuggerServer = {
});
mm.sendAsyncMessage("debug:connect", { prefix: prefix });
return deferred.promise;
},
/**
- * Raises an exception if the server has not been properly initialized.
- */
- _checkInit: function DS_checkInit() {
- if (!this._transportInitialized) {
- throw "DebuggerServer has not been initialized.";
- }
-
- if (!this.createRootActor) {
- throw "Use DebuggerServer.addActors() to add a root actor implementation.";
- }
- },
-
- /**
* Create a new debugger connection for the given transport. Called after
* connectPipe(), from connectToParent, or from an incoming socket
* connection handler.
*
* If present, |aForwardingPrefix| is a forwarding prefix that a parent
* server is using to recognizes messages intended for this server. Ensure
* that all our actors have names beginning with |aForwardingPrefix + '/'|.
* In particular, the root actor's name will be |aForwardingPrefix + '/root'|.