Bug 1334293 - Use the typeName for source and thread actors. r=ochameau
MozReview-Commit-ID: IpreKTT0hrt
--- a/devtools/server/actors/common.js
+++ b/devtools/server/actors/common.js
@@ -230,19 +230,19 @@ ActorPool.prototype = {
* from the connection.
*
* @param Object actor
* The actor to be added to the pool.
*/
addActor: function APAddActor(actor) {
actor.conn = this.conn;
if (!actor.actorID) {
- let prefix = actor.actorPrefix;
+ // Older style actors use actorPrefix, while protocol.js-based actors use typeName
+ let prefix = actor.actorPrefix || actor.typeName;
if (!prefix && typeof actor == "function") {
- // typeName is a convention used with protocol.js-based actors
prefix = actor.prototype.actorPrefix || actor.prototype.typeName;
}
actor.actorID = this.conn.allocID(prefix || undefined);
}
// If the actor is already in a pool, remove it without destroying it.
if (actor.registeredPool) {
delete actor.registeredPool._actors[actor.actorID];