|
@@ -46,6 +46,8 @@ const
|
|
'Object'
|
|
'Object'
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+ JOB_Undefined = Pointer(1);
|
|
|
|
+
|
|
type
|
|
type
|
|
|
|
|
|
{ TJOB_JSValue }
|
|
{ TJOB_JSValue }
|
|
@@ -96,7 +98,8 @@ type
|
|
|
|
|
|
TJOBInvokeGetType = (
|
|
TJOBInvokeGetType = (
|
|
jigCall, // call function
|
|
jigCall, // call function
|
|
- jigGetter // read property
|
|
|
|
|
|
+ jigGetter, // read property
|
|
|
|
+ jigNew // new operator
|
|
);
|
|
);
|
|
TJOBInvokeSetType = (
|
|
TJOBInvokeSetType = (
|
|
jisCall, // call function
|
|
jisCall, // call function
|
|
@@ -106,11 +109,34 @@ type
|
|
TJSObject = class;
|
|
TJSObject = class;
|
|
TJSObjectClass = class of TJSObject;
|
|
TJSObjectClass = class of TJSObject;
|
|
|
|
|
|
|
|
+ { IJSObject }
|
|
|
|
+
|
|
IJSObject = interface
|
|
IJSObject = interface
|
|
- function GetObjectID: TJOBObjectID;
|
|
|
|
- function GetClassName: string;
|
|
|
|
- property ObjectID: TJOBObjectID read GetObjectID;
|
|
|
|
- property ClassName: string read GetClassName;
|
|
|
|
|
|
+ ['{BE5CDE03-D471-4AB3-8F27-A5EA637416F7}']
|
|
|
|
+ function GetJSObjectID: TJOBObjectID;
|
|
|
|
+ function GetPascalClassName: string;
|
|
|
|
+ procedure InvokeJSNoResult(const aName: string; Const Args: Array of const; Invoke: TJOBInvokeSetType = jisCall); virtual;
|
|
|
|
+ function InvokeJSBooleanResult(const aName: string; Const Args: Array of const; Invoke: TJOBInvokeGetType = jigCall): Boolean; virtual;
|
|
|
|
+ function InvokeJSDoubleResult(const aName: string; Const Args: Array of const; Invoke: TJOBInvokeGetType = jigCall): Double; virtual;
|
|
|
|
+ function InvokeJSUnicodeStringResult(const aName: string; Const Args: Array of const; Invoke: TJOBInvokeGetType = jigCall): UnicodeString; virtual;
|
|
|
|
+ function InvokeJSObjectResult(const aName: string; Const Args: Array of const; aResultClass: TJSObjectClass; Invoke: TJOBInvokeGetType = jigCall): TJSObject; virtual;
|
|
|
|
+ function InvokeJSValueResult(const aName: string; Const Args: Array of const; Invoke: TJOBInvokeGetType = jigCall): TJOB_JSValue; virtual;
|
|
|
|
+ function InvokeJSUtf8StringResult(const aName: string; Const args: Array of const; Invoke: TJOBInvokeGetType = jigCall): String; virtual;
|
|
|
|
+ function InvokeJSLongIntResult(const aName: string; Const args: Array of const; Invoke: TJOBInvokeGetType = jigCall): LongInt; virtual;
|
|
|
|
+ function ReadJSPropertyBoolean(const aName: string): boolean; virtual;
|
|
|
|
+ function ReadJSPropertyDouble(const aName: string): double; virtual;
|
|
|
|
+ function ReadJSPropertyUnicodeString(const aName: string): UnicodeString; virtual;
|
|
|
|
+ function ReadJSPropertyObject(const aName: string; aResultClass: TJSObjectClass): TJSObject; virtual;
|
|
|
|
+ function ReadJSPropertyUtf8String(const aName: string): string; virtual;
|
|
|
|
+ function ReadJSPropertyLongInt(const aName: string): LongInt; virtual;
|
|
|
|
+ function ReadJSPropertyValue(const aName: string): TJOB_JSValue; virtual;
|
|
|
|
+ procedure WriteJSPropertyBoolean(const aName: string; Value: Boolean); virtual;
|
|
|
|
+ procedure WriteJSPropertyDouble(const aName: string; Value: Double); virtual;
|
|
|
|
+ procedure WriteJSPropertyUnicodeString(const aName: string; const Value: UnicodeString); virtual;
|
|
|
|
+ procedure WriteJSPropertyUtf8String(const aName: string; const Value: String); virtual;
|
|
|
|
+ procedure WriteJSPropertyObject(const aName: string; Value: TJSObject); virtual;
|
|
|
|
+ procedure WriteJSPropertyLongInt(const aName: string; Value: LongInt); virtual;
|
|
|
|
+ function NewJSObject(Const Args: Array of const; aResultClass: TJSObjectClass): TJSObject; virtual;
|
|
end;
|
|
end;
|
|
|
|
|
|
{ TJOB_JSValueObject }
|
|
{ TJOB_JSValueObject }
|
|
@@ -128,8 +154,8 @@ type
|
|
private
|
|
private
|
|
FObjectID: TJOBObjectID;
|
|
FObjectID: TJOBObjectID;
|
|
protected
|
|
protected
|
|
- function GetObjectID: TJOBObjectID;
|
|
|
|
- function GetClassName: string;
|
|
|
|
|
|
+ function GetJSObjectID: TJOBObjectID;
|
|
|
|
+ function GetPascalClassName: string;
|
|
function FetchString(Len: NativeInt): UnicodeString;
|
|
function FetchString(Len: NativeInt): UnicodeString;
|
|
function InvokeJSOneResult(const aName: string; Const Args: Array of const;
|
|
function InvokeJSOneResult(const aName: string; Const Args: Array of const;
|
|
const InvokeFunc: TJOBInvokeOneResultFunc; ResultP: PByte; Invoke: TJOBInvokeGetType): TJOBResult;
|
|
const InvokeFunc: TJOBInvokeOneResultFunc; ResultP: PByte; Invoke: TJOBInvokeGetType): TJOBResult;
|
|
@@ -156,18 +182,19 @@ type
|
|
function ReadJSPropertyUtf8String(const aName: string): string; virtual;
|
|
function ReadJSPropertyUtf8String(const aName: string): string; virtual;
|
|
function ReadJSPropertyLongInt(const aName: string): LongInt; virtual;
|
|
function ReadJSPropertyLongInt(const aName: string): LongInt; virtual;
|
|
function ReadJSPropertyValue(const aName: string): TJOB_JSValue; virtual;
|
|
function ReadJSPropertyValue(const aName: string): TJOB_JSValue; virtual;
|
|
- // ToDo: get JSValue property
|
|
|
|
procedure WriteJSPropertyBoolean(const aName: string; Value: Boolean); virtual;
|
|
procedure WriteJSPropertyBoolean(const aName: string; Value: Boolean); virtual;
|
|
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;
|
|
procedure WriteJSPropertyObject(const aName: string; Value: TJSObject); 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;
|
|
|
|
+ function NewJSObject(Const Args: Array of const; aResultClass: TJSObjectClass): TJSObject; virtual;
|
|
end;
|
|
end;
|
|
|
|
|
|
var
|
|
var
|
|
- JSDocument: TJSObject; // ToDo
|
|
|
|
|
|
+ JSObject: TJSObject;
|
|
|
|
|
|
|
|
+// imported functions from browser
|
|
function __job_invoke_noresult(
|
|
function __job_invoke_noresult(
|
|
ObjID: TJOBObjectID;
|
|
ObjID: TJOBObjectID;
|
|
NameP: PChar;
|
|
NameP: PChar;
|
|
@@ -182,7 +209,7 @@ function __job_invoke_boolresult(
|
|
NameLen: longint;
|
|
NameLen: longint;
|
|
Invoke: longint;
|
|
Invoke: longint;
|
|
ArgP: PByte;
|
|
ArgP: PByte;
|
|
- ResultP: PByte // bytebool
|
|
|
|
|
|
+ ResultByteBoolP: PByte
|
|
): TJOBResult; external JOBExportName name JOBFn_InvokeBooleanResult;
|
|
): TJOBResult; external JOBExportName name JOBFn_InvokeBooleanResult;
|
|
|
|
|
|
function __job_invoke_doubleresult(
|
|
function __job_invoke_doubleresult(
|
|
@@ -191,7 +218,7 @@ function __job_invoke_doubleresult(
|
|
NameLen: longint;
|
|
NameLen: longint;
|
|
Invoke: longint;
|
|
Invoke: longint;
|
|
ArgP: PByte;
|
|
ArgP: PByte;
|
|
- ResultP: PByte // double
|
|
|
|
|
|
+ ResultDoubleP: PByte
|
|
): TJOBResult; external JOBExportName name JOBFn_InvokeDoubleResult;
|
|
): TJOBResult; external JOBExportName name JOBFn_InvokeDoubleResult;
|
|
|
|
|
|
function __job_invoke_stringresult(
|
|
function __job_invoke_stringresult(
|
|
@@ -200,7 +227,7 @@ function __job_invoke_stringresult(
|
|
NameLen: longint;
|
|
NameLen: longint;
|
|
Invoke: longint;
|
|
Invoke: longint;
|
|
ArgP: PByte;
|
|
ArgP: PByte;
|
|
- ResultLenP: PByte // length
|
|
|
|
|
|
+ ResultLenP: PByte // nativeint
|
|
): TJOBResult; external JOBExportName name JOBFn_InvokeStringResult;
|
|
): TJOBResult; external JOBExportName name JOBFn_InvokeStringResult;
|
|
|
|
|
|
function __job_getstringresult(
|
|
function __job_getstringresult(
|
|
@@ -216,7 +243,7 @@ function __job_invoke_objectresult(
|
|
NameLen: longint;
|
|
NameLen: longint;
|
|
Invoke: longint;
|
|
Invoke: longint;
|
|
ArgP: PByte;
|
|
ArgP: PByte;
|
|
- ResultP: PByte // nativeint
|
|
|
|
|
|
+ ResultObjIDP: PByte // nativeint
|
|
): TJOBResult; external JOBExportName name JOBFn_InvokeObjectResult;
|
|
): TJOBResult; external JOBExportName name JOBFn_InvokeObjectResult;
|
|
|
|
|
|
function __job_release_object(
|
|
function __job_release_object(
|
|
@@ -229,7 +256,7 @@ function __job_invoke_jsvalueresult(
|
|
NameLen: longint;
|
|
NameLen: longint;
|
|
Invoke: longint;
|
|
Invoke: longint;
|
|
ArgP: PByte;
|
|
ArgP: PByte;
|
|
- ResultP: PByte
|
|
|
|
|
|
+ ResultP: PByte // various
|
|
): TJOBResult; external JOBExportName name JOBFn_InvokeJSValueResult;
|
|
): TJOBResult; external JOBExportName name JOBFn_InvokeJSValueResult;
|
|
|
|
|
|
implementation
|
|
implementation
|
|
@@ -237,11 +264,12 @@ implementation
|
|
const
|
|
const
|
|
InvokeGetToInt: array[TJOBInvokeGetType] of integer = (
|
|
InvokeGetToInt: array[TJOBInvokeGetType] of integer = (
|
|
JOBInvokeCall,
|
|
JOBInvokeCall,
|
|
- JOBInvokeGetter
|
|
|
|
|
|
+ JOBInvokeGet,
|
|
|
|
+ JOBInvokeNew
|
|
);
|
|
);
|
|
InvokeSetToInt: array[TJOBInvokeSetType] of integer = (
|
|
InvokeSetToInt: array[TJOBInvokeSetType] of integer = (
|
|
JOBInvokeCall,
|
|
JOBInvokeCall,
|
|
- JOBInvokeSetter
|
|
|
|
|
|
+ JOBInvokeSet
|
|
);
|
|
);
|
|
|
|
|
|
{$IFDEF VerboseJOB}
|
|
{$IFDEF VerboseJOB}
|
|
@@ -273,6 +301,13 @@ begin
|
|
Result:='vt?';
|
|
Result:='vt?';
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
+
|
|
|
|
+function __job_callback(w: NativeInt): boolean;
|
|
|
|
+begin
|
|
|
|
+ writeln('__job_callback w=',w);
|
|
|
|
+ Result:=true;
|
|
|
|
+end;
|
|
|
|
+
|
|
{$ENDIF}
|
|
{$ENDIF}
|
|
|
|
|
|
{ TJOB_JSValue }
|
|
{ TJOB_JSValue }
|
|
@@ -345,17 +380,17 @@ begin
|
|
if Value=nil then
|
|
if Value=nil then
|
|
Result:='nil'
|
|
Result:='nil'
|
|
else
|
|
else
|
|
- Result:='['+IntToStr(Value.ObjectID)+']:'+Value.ClassName;
|
|
|
|
|
|
+ Result:='['+IntToStr(Value.GetJSObjectID)+']:'+Value.GetPascalClassName;
|
|
end;
|
|
end;
|
|
|
|
|
|
{ TJSObject }
|
|
{ TJSObject }
|
|
|
|
|
|
-function TJSObject.GetObjectID: TJOBObjectID;
|
|
|
|
|
|
+function TJSObject.GetJSObjectID: TJOBObjectID;
|
|
begin
|
|
begin
|
|
Result:=FObjectID;
|
|
Result:=FObjectID;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function TJSObject.GetClassName: string;
|
|
|
|
|
|
+function TJSObject.GetPascalClassName: string;
|
|
begin
|
|
begin
|
|
Result:=ClassName;
|
|
Result:=ClassName;
|
|
end;
|
|
end;
|
|
@@ -467,7 +502,14 @@ begin
|
|
end;
|
|
end;
|
|
{$endif}
|
|
{$endif}
|
|
vtString : inc(Len,1+SizeOf(NativeInt)+SizeOf(PByte));
|
|
vtString : inc(Len,1+SizeOf(NativeInt)+SizeOf(PByte));
|
|
- vtPointer,
|
|
|
|
|
|
+ vtPointer:
|
|
|
|
+ begin
|
|
|
|
+ p:=Args[i].VPointer;
|
|
|
|
+ if p=JOB_Undefined then
|
|
|
|
+ inc(Len)
|
|
|
|
+ else
|
|
|
|
+ inc(Len,1+SizeOf(PByte));
|
|
|
|
+ end;
|
|
vtPChar :
|
|
vtPChar :
|
|
begin
|
|
begin
|
|
strlen(Args[i].VPChar);
|
|
strlen(Args[i].VPChar);
|
|
@@ -485,14 +527,25 @@ begin
|
|
end;
|
|
end;
|
|
vtClass : RaiseNotSupported('class');
|
|
vtClass : RaiseNotSupported('class');
|
|
vtPWideChar : RaiseNotSupported('pwidechar');
|
|
vtPWideChar : RaiseNotSupported('pwidechar');
|
|
- vtAnsiString : inc(Len,1+SizeOf(NativeInt)+SizeOf(PByte));
|
|
|
|
|
|
+ vtAnsiString:
|
|
|
|
+ inc(Len,1+SizeOf(NativeInt)+SizeOf(PByte));
|
|
vtCurrency : RaiseNotSupported('currency');
|
|
vtCurrency : RaiseNotSupported('currency');
|
|
{$ifdef FPC_HAS_FEATURE_VARIANTS}
|
|
{$ifdef FPC_HAS_FEATURE_VARIANTS}
|
|
vtVariant : RaiseNotSupported('variant');
|
|
vtVariant : RaiseNotSupported('variant');
|
|
{$endif FPC_HAS_FEATURE_VARIANTS}
|
|
{$endif FPC_HAS_FEATURE_VARIANTS}
|
|
- vtInterface : RaiseNotSupported('interface');
|
|
|
|
- vtWideString : inc(Len,1+SizeOf(NativeInt)+SizeOf(PByte));
|
|
|
|
- vtInt64 :
|
|
|
|
|
|
+ vtInterface:
|
|
|
|
+ begin
|
|
|
|
+ p:=Args[i].VInterface;
|
|
|
|
+ if p=nil then
|
|
|
|
+ inc(Len,1)
|
|
|
|
+ else if IInterface(p) is IJSObject then
|
|
|
|
+ inc(Len,1+sizeof(TJOBObjectID))
|
|
|
|
+ else
|
|
|
|
+ RaiseNotSupported('interface');
|
|
|
|
+ end;
|
|
|
|
+ vtWideString:
|
|
|
|
+ inc(Len,1+SizeOf(NativeInt)+SizeOf(PByte));
|
|
|
|
+ vtInt64:
|
|
begin
|
|
begin
|
|
i64:=Args[i].VInt64^;
|
|
i64:=Args[i].VInt64^;
|
|
if (i64<MinSafeIntDouble) or (i64>MaxSafeIntDouble) then
|
|
if (i64<MinSafeIntDouble) or (i64>MaxSafeIntDouble) then
|
|
@@ -503,7 +556,7 @@ begin
|
|
inc(Len,9);
|
|
inc(Len,9);
|
|
end;
|
|
end;
|
|
vtUnicodeString : inc(Len,1+SizeOf(NativeInt)+SizeOf(PByte));
|
|
vtUnicodeString : inc(Len,1+SizeOf(NativeInt)+SizeOf(PByte));
|
|
- vtQWord :
|
|
|
|
|
|
+ vtQWord:
|
|
begin
|
|
begin
|
|
qw:=Args[i].VQWord^;
|
|
qw:=Args[i].VQWord^;
|
|
if (qw>MaxSafeIntDouble) then
|
|
if (qw>MaxSafeIntDouble) then
|
|
@@ -523,14 +576,14 @@ begin
|
|
for i:=0 to high(Args) do
|
|
for i:=0 to high(Args) do
|
|
begin
|
|
begin
|
|
case Args[i].VType of
|
|
case Args[i].VType of
|
|
- vtInteger :
|
|
|
|
|
|
+ vtInteger:
|
|
begin
|
|
begin
|
|
p^:=JOBArgLongint;
|
|
p^:=JOBArgLongint;
|
|
inc(p);
|
|
inc(p);
|
|
PLongint(p)^:=Args[i].VInteger;
|
|
PLongint(p)^:=Args[i].VInteger;
|
|
inc(p,4);
|
|
inc(p,4);
|
|
end;
|
|
end;
|
|
- vtBoolean :
|
|
|
|
|
|
+ vtBoolean:
|
|
begin
|
|
begin
|
|
if Args[i].VBoolean then
|
|
if Args[i].VBoolean then
|
|
p^:=JOBArgTrue
|
|
p^:=JOBArgTrue
|
|
@@ -539,7 +592,7 @@ begin
|
|
inc(p);
|
|
inc(p);
|
|
end;
|
|
end;
|
|
{$ifndef FPUNONE}
|
|
{$ifndef FPUNONE}
|
|
- vtExtended :
|
|
|
|
|
|
+ vtExtended:
|
|
begin
|
|
begin
|
|
p^:=JOBArgDouble;
|
|
p^:=JOBArgDouble;
|
|
inc(p);
|
|
inc(p);
|
|
@@ -554,14 +607,14 @@ begin
|
|
PWord(p)^:=ord(Args[i].VChar);
|
|
PWord(p)^:=ord(Args[i].VChar);
|
|
inc(p,2);
|
|
inc(p,2);
|
|
end;
|
|
end;
|
|
- vtWideChar :
|
|
|
|
|
|
+ vtWideChar:
|
|
begin
|
|
begin
|
|
p^:=JOBArgChar;
|
|
p^:=JOBArgChar;
|
|
inc(p);
|
|
inc(p);
|
|
PWord(p)^:=ord(Args[i].VWideChar);
|
|
PWord(p)^:=ord(Args[i].VWideChar);
|
|
inc(p,2);
|
|
inc(p,2);
|
|
end;
|
|
end;
|
|
- vtString :
|
|
|
|
|
|
+ vtString:
|
|
begin
|
|
begin
|
|
// shortstring
|
|
// shortstring
|
|
p^:=JOBArgUTF8String;
|
|
p^:=JOBArgUTF8String;
|
|
@@ -575,12 +628,20 @@ begin
|
|
end;
|
|
end;
|
|
vtPointer:
|
|
vtPointer:
|
|
begin
|
|
begin
|
|
- p^:=JOBArgPointer;
|
|
|
|
- inc(p);
|
|
|
|
- PPointer(p)^:=Args[i].VPointer;
|
|
|
|
- inc(p,sizeof(Pointer));
|
|
|
|
|
|
+ h:=Args[i].VPointer;
|
|
|
|
+ if h=JOB_Undefined then
|
|
|
|
+ begin
|
|
|
|
+ p^:=JOBArgNone;
|
|
|
|
+ inc(p);
|
|
|
|
+ end
|
|
|
|
+ else begin
|
|
|
|
+ p^:=JOBArgPointer;
|
|
|
|
+ inc(p);
|
|
|
|
+ PPointer(p)^:=h;
|
|
|
|
+ inc(p,sizeof(Pointer));
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
- vtPChar :
|
|
|
|
|
|
+ vtPChar:
|
|
begin
|
|
begin
|
|
p^:=JOBArgUTF8String;
|
|
p^:=JOBArgUTF8String;
|
|
inc(p);
|
|
inc(p);
|
|
@@ -590,7 +651,7 @@ begin
|
|
PPointer(p)^:=h;
|
|
PPointer(p)^:=h;
|
|
inc(p,sizeof(Pointer));
|
|
inc(p,sizeof(Pointer));
|
|
end;
|
|
end;
|
|
- vtObject :
|
|
|
|
|
|
+ vtObject:
|
|
begin
|
|
begin
|
|
Obj:=Args[i].VObject;
|
|
Obj:=Args[i].VObject;
|
|
if Obj=nil then
|
|
if Obj=nil then
|
|
@@ -600,7 +661,7 @@ begin
|
|
end else begin
|
|
end else begin
|
|
p^:=JOBArgObject;
|
|
p^:=JOBArgObject;
|
|
inc(p);
|
|
inc(p);
|
|
- PNativeInt(p)^:=TJSObject(Args[i].VObject).ObjectID;
|
|
|
|
|
|
+ PNativeInt(p)^:=TJSObject(Obj).ObjectID;
|
|
inc(p,sizeof(NativeInt));
|
|
inc(p,sizeof(NativeInt));
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
@@ -621,8 +682,21 @@ begin
|
|
{$ifdef FPC_HAS_FEATURE_VARIANTS}
|
|
{$ifdef FPC_HAS_FEATURE_VARIANTS}
|
|
vtVariant : ;
|
|
vtVariant : ;
|
|
{$endif FPC_HAS_FEATURE_VARIANTS}
|
|
{$endif FPC_HAS_FEATURE_VARIANTS}
|
|
- vtInterface : ;
|
|
|
|
- vtWideString :
|
|
|
|
|
|
+ vtInterface:
|
|
|
|
+ begin
|
|
|
|
+ h:=Args[i].VInterface;
|
|
|
|
+ if h=nil then
|
|
|
|
+ begin
|
|
|
|
+ p^:=JOBArgNil;
|
|
|
|
+ inc(p);
|
|
|
|
+ end else begin
|
|
|
|
+ p^:=JOBArgObject;
|
|
|
|
+ inc(p);
|
|
|
|
+ PNativeInt(p)^:=IJSObject(h).GetJSObjectID;
|
|
|
|
+ inc(p,sizeof(NativeInt));
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
|
|
+ vtWideString:
|
|
begin
|
|
begin
|
|
p^:=JOBArgUnicodeString;
|
|
p^:=JOBArgUnicodeString;
|
|
inc(p);
|
|
inc(p);
|
|
@@ -633,7 +707,7 @@ begin
|
|
PPointer(p)^:=h;
|
|
PPointer(p)^:=h;
|
|
inc(p,sizeof(Pointer));
|
|
inc(p,sizeof(Pointer));
|
|
end;
|
|
end;
|
|
- vtInt64 :
|
|
|
|
|
|
+ vtInt64:
|
|
begin
|
|
begin
|
|
i64:=Args[i].VInt64^;
|
|
i64:=Args[i].VInt64^;
|
|
if (i64>=low(longint)) and (i64<=high(longint)) then
|
|
if (i64>=low(longint)) and (i64<=high(longint)) then
|
|
@@ -649,7 +723,7 @@ begin
|
|
inc(p,8);
|
|
inc(p,8);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
- vtUnicodeString :
|
|
|
|
|
|
+ vtUnicodeString:
|
|
begin
|
|
begin
|
|
p^:=JOBArgUnicodeString;
|
|
p^:=JOBArgUnicodeString;
|
|
inc(p);
|
|
inc(p);
|
|
@@ -660,7 +734,7 @@ begin
|
|
PPointer(p)^:=h;
|
|
PPointer(p)^:=h;
|
|
inc(p,sizeof(Pointer));
|
|
inc(p,sizeof(Pointer));
|
|
end;
|
|
end;
|
|
- vtQWord :
|
|
|
|
|
|
+ vtQWord:
|
|
begin
|
|
begin
|
|
qw:=Args[i].VQWord^;
|
|
qw:=Args[i].VQWord^;
|
|
if (qw<=high(longint)) then
|
|
if (qw<=high(longint)) then
|
|
@@ -902,8 +976,14 @@ begin
|
|
InvokeJSNoResult(aName,[Value],jisSetter);
|
|
InvokeJSNoResult(aName,[Value],jisSetter);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TJSObject.NewJSObject(const Args: array of const;
|
|
|
|
+ aResultClass: TJSObjectClass): TJSObject;
|
|
|
|
+begin
|
|
|
|
+ Result:=InvokeJSObjectResult('',Args,aResultClass,jigNew);
|
|
|
|
+end;
|
|
|
|
+
|
|
initialization
|
|
initialization
|
|
- JSDocument:=TJSObject.CreateFromID(JOBObjIdDocument);
|
|
|
|
|
|
+ JSObject:=TJSObject.CreateFromID(JOBObjIdObject);
|
|
|
|
|
|
end.
|
|
end.
|
|
|
|
|