diff --git a/src/Data/DataDeserializer.js b/src/Data/DataDeserializer.js index ead2736..d2ae9c8 100644 --- a/src/Data/DataDeserializer.js +++ b/src/Data/DataDeserializer.js @@ -172,7 +172,7 @@ export default class DataDeserializer { let record; if (template.definedType != null) { - record = Warehouse.createInstance(template.definedType); + record = new template.definedType(); } else { record = new Record(); } @@ -221,7 +221,7 @@ export default class DataDeserializer { if (template != null) { if (template.definedType != null) { - var enumVal = Warehouse.createInstance(template.definedType); + var enumVal = new template.definedType(); enumVal.index = index; enumVal.name = template.constants[index].name; enumVal.value = template.constants[index].value; @@ -238,7 +238,7 @@ export default class DataDeserializer { connection.getTemplate(classId).then((tmp) => { if (tmp != null) { if (tmp.definedType != null) { - var enumVal = Warehouse.createInstance(tmp.definedType); + var enumVal = new tmp.definedType(); enumVal.index = index; enumVal.name = tmp.constants[index].name; enumVal.value = tmp.constants[index].value; diff --git a/src/Data/RepresentationType.js b/src/Data/RepresentationType.js index a53a4bd..c0d41ed 100644 --- a/src/Data/RepresentationType.js +++ b/src/Data/RepresentationType.js @@ -132,7 +132,7 @@ export class RepresentationTypeParseResults { export default class RepresentationType { - static getRuntimeType() { + getRuntimeType() { let runtimeType = null; if (IdentifierToTypeMap[this.identifier] != undefined) diff --git a/src/Net/IIP/DistributedConnection.js b/src/Net/IIP/DistributedConnection.js index 2e15860..3f3e30f 100644 --- a/src/Net/IIP/DistributedConnection.js +++ b/src/Net/IIP/DistributedConnection.js @@ -2586,7 +2586,7 @@ export default class DistributedConnection extends IStore { { template = Warehouse.getTemplateByClassId(classId, TemplateType.Wrapper); if (template?.definedType != null) - dr = new template.getDependencies(self, id, rt[1], rt[2]); + dr = new template.definedType(self, id, rt[1], rt[2]); else dr = new DistributedResource(self, id, rt[1], rt[2]); } @@ -2640,7 +2640,7 @@ export default class DistributedConnection extends IStore { }); } else { if (resource == null) { - Warehouse.put(id.toString(), dr, this, null, template) + Warehouse.put(id.toString(), dr, self, null, template) .then(initResource) .error((ex) => reply.triggerError(ex)); } else { diff --git a/src/Resource/Template/TypeTemplate.js b/src/Resource/Template/TypeTemplate.js index 57246c4..c49d678 100644 --- a/src/Resource/Template/TypeTemplate.js +++ b/src/Resource/Template/TypeTemplate.js @@ -244,7 +244,7 @@ export default class TypeTemplate { if (type.prototype instanceof DistributedResource) this.templateType = TemplateType.Wrapper; - if (type.prototype instanceof IRecord) + else if (type.prototype instanceof IRecord) this.templateType = TemplateType.Record; else if (type.prototype instanceof IResource) this.templateType = TemplateType.Resource; diff --git a/src/Resource/Warehouse.js b/src/Resource/Warehouse.js index 1979092..f3758b7 100644 --- a/src/Resource/Warehouse.js +++ b/src/Resource/Warehouse.js @@ -318,7 +318,7 @@ export class WH extends IEventHandler if (type.prototype instanceof DistributedResource) templateType = TemplateType.Wrapper; - if (type.prototype instanceof IResource) + else if (type.prototype instanceof IResource) templateType = TemplateType.Resource; else if (type.prototype instanceof IRecord) templateType = TemplateType.Record;