diff --git a/browser/devtools/webide/content/monitor.js b/browser/devtools/webide/content/monitor.js index b2ee98849495..8c6562899fa0 100644 --- a/browser/devtools/webide/content/monitor.js +++ b/browser/devtools/webide/content/monitor.js @@ -295,7 +295,6 @@ function MonitorClient(client, form) { MonitorClient.prototype.destroy = function () { this.client.unregisterClient(this); } -MonitorClient.prototype.detach = function () {} MonitorClient.prototype.start = function () { this.client.request({ to: this.actor, diff --git a/toolkit/devtools/client/dbg-client.jsm b/toolkit/devtools/client/dbg-client.jsm index a5ec414fa17d..1b31d3020847 100644 --- a/toolkit/devtools/client/dbg-client.jsm +++ b/toolkit/devtools/client/dbg-client.jsm @@ -420,7 +420,11 @@ DebuggerClient.prototype = { this._transport = null; return; } - client.detach(detachClients); + if (client.detach) { + client.detach(detachClients); + return; + } + detachClients(); }; detachClients(); }, @@ -1008,13 +1012,9 @@ DebuggerClient.prototype = { } if (client.events.length > 0 && typeof(client.emit) != "function") { throw new Error("DebuggerServer.registerClient expects " + - "client instances with non-empty `events` array to" + + "a client instance with non-empty `events` array to" + "have an `emit` function."); } - if (typeof(client.detach) != "function") { - throw new Error("DebuggerServer.registerClient expects " + - "a client instance with a `detach` function."); - } if (this._clients.has(actorID)) { throw new Error("DebuggerServer.registerClient already registered " + "a client for this actor."); diff --git a/toolkit/devtools/server/tests/unit/test_monitor_actor.js b/toolkit/devtools/server/tests/unit/test_monitor_actor.js index f15aa31f66d4..817bcd58658c 100644 --- a/toolkit/devtools/server/tests/unit/test_monitor_actor.js +++ b/toolkit/devtools/server/tests/unit/test_monitor_actor.js @@ -27,7 +27,6 @@ function run_test() MonitorClient.prototype.destroy = function () { client.unregisterClient(this); } - MonitorClient.prototype.detach = function () {} MonitorClient.prototype.start = function (callback) { this.client.request({ to: this.actor,