Bug 1049835 - Don't require actor clients to have a detach method. r=ochameau

This commit is contained in:
Jan Keromnes 2014-08-18 06:14:00 -04:00
parent 9894feff1b
commit 931b838202
3 changed files with 6 additions and 8 deletions

View File

@ -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,

View File

@ -420,7 +420,11 @@ DebuggerClient.prototype = {
this._transport = null;
return;
}
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.");

View File

@ -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,