2
0
mirror of https://github.com/esiur/esiur-js.git synced 2025-05-06 04:22:58 +00:00
This commit is contained in:
Ahmed Zamil 2022-09-11 13:43:55 +03:00
parent 90a67b66a3
commit 4aa71458bc
4 changed files with 7 additions and 9 deletions

View File

@ -352,10 +352,10 @@ export default class DataSerializer {
static recordComposer(
value, connection) {
var rt = BinaryList();
let rt = new BinaryList();
var template = Warehouse.getTemplateByType(value.constructor);
let template = Warehouse.getTemplateByType(value.constructor);
if (template == null)
return new DataSerializerComposeResults(
@ -363,10 +363,8 @@ export default class DataSerializer {
rt.addDC(DC.guidToBytes(template.classId));
var recordData = value.serialize();
for (var pt in template.properties) {
var propValue = recordData[pt.name];
for (let pt of template.properties) {
let propValue = value[pt.name];
rt.addDC(Codec.compose(propValue, connection));
}

View File

@ -3117,7 +3117,7 @@ export default class DistributedConnection extends IStore {
this._sendParams()
.addUint8(0x40 | IIPPacket.IIPPacketAction.StaticCall)
.addUint8(0x40 | IIPPacketAction.StaticCall)
.addUint32(c)
.addGuid(classId)
.addUint8(index)

View File

@ -442,7 +442,7 @@ export default class TemplateGenerator {
//rt += `var rt = new AsyncReply<${rtTypeName}>();\r\n`;
rt += `\t\tvar rt = new Esiur.Core.AsyncReply();\r\n`;
if (f.isStatic) {
rt += `\t\tconnection.staticCall(Guid.parse('${template.classId.toString()}'), ${f.index}, args)\r\n`;
rt += `\t\tconnection.staticCall(Esiur.Data.Guid.parse('${template.classId.toString()}'), ${f.index}, args)\r\n`;
} else {
rt += `\t\tthis._invoke(${f.index}, args)\r\n`;
}

View File

@ -129,7 +129,7 @@ const namespace = {
define: function(target, type, className) {
let sc = className.split('.');
for(let i = 0; i < sc.length; i++) {
for(let i = 0; i < sc.length - 1; i++) {
if (target[sc[i]] == undefined)
target[sc[i]] = {};
target = target[sc[i]];