mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
Bug 1049835 - Don't require actor clients to have a detach method. r=ochameau
This commit is contained in:
parent
9894feff1b
commit
931b838202
@ -295,7 +295,6 @@ function MonitorClient(client, form) {
|
|||||||
MonitorClient.prototype.destroy = function () {
|
MonitorClient.prototype.destroy = function () {
|
||||||
this.client.unregisterClient(this);
|
this.client.unregisterClient(this);
|
||||||
}
|
}
|
||||||
MonitorClient.prototype.detach = function () {}
|
|
||||||
MonitorClient.prototype.start = function () {
|
MonitorClient.prototype.start = function () {
|
||||||
this.client.request({
|
this.client.request({
|
||||||
to: this.actor,
|
to: this.actor,
|
||||||
|
@ -420,7 +420,11 @@ DebuggerClient.prototype = {
|
|||||||
this._transport = null;
|
this._transport = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
client.detach(detachClients);
|
if (client.detach) {
|
||||||
|
client.detach(detachClients);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
detachClients();
|
||||||
};
|
};
|
||||||
detachClients();
|
detachClients();
|
||||||
},
|
},
|
||||||
@ -1008,13 +1012,9 @@ DebuggerClient.prototype = {
|
|||||||
}
|
}
|
||||||
if (client.events.length > 0 && typeof(client.emit) != "function") {
|
if (client.events.length > 0 && typeof(client.emit) != "function") {
|
||||||
throw new Error("DebuggerServer.registerClient expects " +
|
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.");
|
"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)) {
|
if (this._clients.has(actorID)) {
|
||||||
throw new Error("DebuggerServer.registerClient already registered " +
|
throw new Error("DebuggerServer.registerClient already registered " +
|
||||||
"a client for this actor.");
|
"a client for this actor.");
|
||||||
|
@ -27,7 +27,6 @@ function run_test()
|
|||||||
MonitorClient.prototype.destroy = function () {
|
MonitorClient.prototype.destroy = function () {
|
||||||
client.unregisterClient(this);
|
client.unregisterClient(this);
|
||||||
}
|
}
|
||||||
MonitorClient.prototype.detach = function () {}
|
|
||||||
MonitorClient.prototype.start = function (callback) {
|
MonitorClient.prototype.start = function (callback) {
|
||||||
this.client.request({
|
this.client.request({
|
||||||
to: this.actor,
|
to: this.actor,
|
||||||
|
Loading…
Reference in New Issue
Block a user