|
@@ -85,7 +85,7 @@ Type
|
|
procedure WriteJSPropertyDouble(const aName: string; Value: Double); virtual;
|
|
procedure WriteJSPropertyDouble(const aName: string; Value: Double); virtual;
|
|
procedure WriteJSPropertyUnicodeString(const aName: string; const Value: UnicodeString); virtual;
|
|
procedure WriteJSPropertyUnicodeString(const aName: string; const Value: UnicodeString); virtual;
|
|
procedure WriteJSPropertyUtf8String(const aName: string; const Value: String); virtual;
|
|
procedure WriteJSPropertyUtf8String(const aName: string; const Value: String); virtual;
|
|
- // ToDo: procedure WriteJSPropertyObject(const aName: string; AnObjectID: TJOBObjectID); virtual;
|
|
|
|
|
|
+ procedure WriteJSPropertyObject(const aName: string; Value: TJSObject); virtual;
|
|
procedure WriteJSPropertyLongInt(const aName: string; Value: LongInt); virtual;
|
|
procedure WriteJSPropertyLongInt(const aName: string; Value: LongInt); virtual;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -259,6 +259,7 @@ var
|
|
ws: WideString;
|
|
ws: WideString;
|
|
us: UnicodeString;
|
|
us: UnicodeString;
|
|
d: Double;
|
|
d: Double;
|
|
|
|
+ Obj: TObject;
|
|
begin
|
|
begin
|
|
Result:=nil;
|
|
Result:=nil;
|
|
if length(Args)>255 then
|
|
if length(Args)>255 then
|
|
@@ -289,7 +290,13 @@ begin
|
|
end;
|
|
end;
|
|
vtObject :
|
|
vtObject :
|
|
begin
|
|
begin
|
|
- RaiseNotSupported('object');
|
|
|
|
|
|
+ Obj:=Args[i].VObject;
|
|
|
|
+ if Obj=nil then
|
|
|
|
+ inc(Len,1)
|
|
|
|
+ else if Obj is TJSObject then
|
|
|
|
+ inc(Len,1+sizeof(TJOBObjectID))
|
|
|
|
+ else
|
|
|
|
+ RaiseNotSupported('object');
|
|
end;
|
|
end;
|
|
vtClass : RaiseNotSupported('class');
|
|
vtClass : RaiseNotSupported('class');
|
|
vtPWideChar : RaiseNotSupported('pwidechar');
|
|
vtPWideChar : RaiseNotSupported('pwidechar');
|
|
@@ -398,7 +405,20 @@ begin
|
|
PPointer(p)^:=h;
|
|
PPointer(p)^:=h;
|
|
inc(p,sizeof(Pointer));
|
|
inc(p,sizeof(Pointer));
|
|
end;
|
|
end;
|
|
- vtObject : ;
|
|
|
|
|
|
+ vtObject :
|
|
|
|
+ begin
|
|
|
|
+ Obj:=Args[i].VObject;
|
|
|
|
+ if Obj=nil then
|
|
|
|
+ begin
|
|
|
|
+ p^:=JOBArgNil;
|
|
|
|
+ inc(p);
|
|
|
|
+ end else begin
|
|
|
|
+ p^:=JOBArgObject;
|
|
|
|
+ inc(p);
|
|
|
|
+ PNativeInt(p)^:=TJSObject(Args[i].VObject).ObjectID;
|
|
|
|
+ inc(p,sizeof(NativeInt));
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
vtClass : ;
|
|
vtClass : ;
|
|
vtPWideChar : ;
|
|
vtPWideChar : ;
|
|
vtAnsiString :
|
|
vtAnsiString :
|
|
@@ -558,12 +578,14 @@ begin
|
|
try
|
|
try
|
|
// try to allocate the memory
|
|
// try to allocate the memory
|
|
SetLength(Result,ResultLen);
|
|
SetLength(Result,ResultLen);
|
|
|
|
+ //writeln('TJSObject.InvokeJSUnicodeStringResult ResultLen=',ResultLen);
|
|
aError:=JOBResult_Success;
|
|
aError:=JOBResult_Success;
|
|
finally
|
|
finally
|
|
if aError<>JOBResult_Success then
|
|
if aError<>JOBResult_Success then
|
|
__job_releasestringresult();
|
|
__job_releasestringresult();
|
|
end;
|
|
end;
|
|
__job_getstringresult(PByte(Result));
|
|
__job_getstringresult(PByte(Result));
|
|
|
|
+ //writeln('TJSObject.InvokeJSUnicodeStringResult Result="',Result,'"');
|
|
end;
|
|
end;
|
|
|
|
|
|
function TJSObject.InvokeJSObjResult(const aName: string;
|
|
function TJSObject.InvokeJSObjResult(const aName: string;
|
|
@@ -656,6 +678,12 @@ begin
|
|
InvokeJSNoResult(aName,[Value],jisSetter);
|
|
InvokeJSNoResult(aName,[Value],jisSetter);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TJSObject.WriteJSPropertyObject(const aName: string; Value: TJSObject
|
|
|
|
+ );
|
|
|
|
+begin
|
|
|
|
+ InvokeJSNoResult(aName,[Value],jisSetter);
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TJSObject.WriteJSPropertyLongInt(const aName: string; Value: LongInt);
|
|
procedure TJSObject.WriteJSPropertyLongInt(const aName: string; Value: LongInt);
|
|
begin
|
|
begin
|
|
InvokeJSNoResult(aName,[Value],jisSetter);
|
|
InvokeJSNoResult(aName,[Value],jisSetter);
|