Bug 1295171 - Reintroduce the old Actor/FrontClass constructors. r=jryans
Heintroduce the old Actor/FrontClass constructors.
This commit is contained in:
@@ -1090,6 +1090,23 @@ var generateRequestHandlers = function (actorSpec, actorProto) {
|
||||
};
|
||||
|
||||
/**
|
||||
* THIS METHOD IS DEPRECATED, AND PRESERVED ONLY FOR ADD-ONS. IT SHOULD NOT BE
|
||||
* USED INSIDE THE TREE.
|
||||
*
|
||||
* Create an actor class for the given actor prototype.
|
||||
*
|
||||
* @param object actorProto
|
||||
* The actor prototype. Must have a 'typeName' property,
|
||||
* should have method definitions, can have event definitions.
|
||||
*/
|
||||
exports.ActorClass = function (actorProto) {
|
||||
return ActorClassWithSpec(generateActorSpec(actorProto), actorProto);
|
||||
};
|
||||
|
||||
/**
|
||||
* THIS METHOD IS DEPRECATED, AND PRESERVED ONLY FOR ADD-ONS. IT SHOULD NOT BE
|
||||
* USED INSIDE THE TREE.
|
||||
*
|
||||
* Create an actor class for the given actor specification and prototype.
|
||||
*
|
||||
* @param object actorSpec
|
||||
@@ -1098,7 +1115,7 @@ var generateRequestHandlers = function (actorSpec, actorProto) {
|
||||
* The actor prototype. Should have method definitions, can have event
|
||||
* definitions.
|
||||
*/
|
||||
var ActorClass = function (actorSpec, actorProto) {
|
||||
var ActorClassWithSpec = function (actorSpec, actorProto) {
|
||||
if (!actorSpec.typeName) {
|
||||
throw Error("Actor specification must have a typeName member.");
|
||||
}
|
||||
@@ -1108,7 +1125,7 @@ var ActorClass = function (actorSpec, actorProto) {
|
||||
|
||||
return cls;
|
||||
};
|
||||
exports.ActorClass = ActorClass;
|
||||
exports.ActorClassWithSpec = ActorClassWithSpec;
|
||||
|
||||
/**
|
||||
* Base class for client-side actor fronts.
|
||||
@@ -1410,6 +1427,19 @@ var generateRequestMethods = function (actorSpec, frontProto) {
|
||||
return frontProto;
|
||||
};
|
||||
|
||||
/**
|
||||
* Create a front class for the given actor class and front prototype.
|
||||
*
|
||||
* @param ActorClass actorType
|
||||
* The actor class you're creating a front for.
|
||||
* @param object frontProto
|
||||
* The front prototype. Must have a 'typeName' property,
|
||||
* should have method definitions, can have event definitions.
|
||||
*/
|
||||
exports.FrontClass = function (actorType, frontProto) {
|
||||
return FrontClassWithSpec(prototypeOf(actorType)._actorSpec, frontProto);
|
||||
};
|
||||
|
||||
/**
|
||||
* Create a front class for the given actor specification and front prototype.
|
||||
*
|
||||
@@ -1419,7 +1449,7 @@ var generateRequestMethods = function (actorSpec, frontProto) {
|
||||
* The object prototype. Must have a 'typeName' property,
|
||||
* should have method definitions, can have event definitions.
|
||||
*/
|
||||
var FrontClass = function (actorSpec, frontProto) {
|
||||
var FrontClassWithSpec = function (actorSpec, frontProto) {
|
||||
frontProto.extends = Front;
|
||||
let cls = Class(generateRequestMethods(actorSpec, frontProto));
|
||||
|
||||
@@ -1430,7 +1460,7 @@ var FrontClass = function (actorSpec, frontProto) {
|
||||
|
||||
return cls;
|
||||
};
|
||||
exports.FrontClass = FrontClass;
|
||||
exports.FrontClassWithSpec = FrontClassWithSpec;
|
||||
|
||||
exports.dumpActorSpec = function (type) {
|
||||
let actorSpec = type.actorSpec;
|
||||
|
||||
Reference in New Issue
Block a user