mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-01 23:30:20 +02:00
* JOB debugobject call
This commit is contained in:
parent
334102e391
commit
1f0c72b6c1
@ -302,6 +302,7 @@ type
|
|||||||
procedure WriteJSPropertyMethod(const aName: UTF8String; const Value: TMethod); virtual;
|
procedure WriteJSPropertyMethod(const aName: UTF8String; const Value: TMethod); virtual;
|
||||||
// create a new object using the new-operator
|
// create a new object using the new-operator
|
||||||
function NewJSObject(Const Args: Array of const; aResultClass: TJSObjectClass): TJSObject; virtual;
|
function NewJSObject(Const Args: Array of const; aResultClass: TJSObjectClass): TJSObject; virtual;
|
||||||
|
procedure ShowAsDebug;
|
||||||
// JS members
|
// JS members
|
||||||
function getOwnPropertyNames(const Obj: IJSObject): TUnicodeStringDynArray;
|
function getOwnPropertyNames(const Obj: IJSObject): TUnicodeStringDynArray;
|
||||||
function getPrototypeOf(const Obj: IJSObject): IJSObject;
|
function getPrototypeOf(const Obj: IJSObject): IJSObject;
|
||||||
@ -361,6 +362,7 @@ type
|
|||||||
constructor JOBCreate(aOwnsObjectID : Boolean; const Args : Array of const);
|
constructor JOBCreate(aOwnsObjectID : Boolean; const Args : Array of const);
|
||||||
class function JSClassName : UnicodeString; virtual;
|
class function JSClassName : UnicodeString; virtual;
|
||||||
class function Cast(const Intf: IJSObject): IJSObject; overload;
|
class function Cast(const Intf: IJSObject): IJSObject; overload;
|
||||||
|
procedure ShowAsDebug;
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
property JOBObjectID: TJOBObjectID read FJOBObjectID;
|
property JOBObjectID: TJOBObjectID read FJOBObjectID;
|
||||||
@ -1365,11 +1367,17 @@ procedure __job_set_array_from_mem (
|
|||||||
aMaxLen : cardinal
|
aMaxLen : cardinal
|
||||||
); external JOBExportName name JOBFn_SetArrayFromMem;
|
); external JOBExportName name JOBFn_SetArrayFromMem;
|
||||||
|
|
||||||
|
function __job_debug_object (
|
||||||
|
aObjectID : integer;
|
||||||
|
aFlags : Longint) : longint; external JOBExportName name JOBFn_DebugObject;
|
||||||
|
|
||||||
function JOBCallback(const Func: TJOBCallback; Data, Code: Pointer; Args: PByte): PByte;
|
function JOBCallback(const Func: TJOBCallback; Data, Code: Pointer; Args: PByte): PByte;
|
||||||
function VarRecToJSValue(const V: TVarRec): TJOB_JSValue;
|
function VarRecToJSValue(const V: TVarRec): TJOB_JSValue;
|
||||||
|
|
||||||
|
Procedure DebugObject(aObject : IJSObject);
|
||||||
|
Procedure DebugObject(aObject : TJSObject);
|
||||||
|
Procedure DebugObject(aObject : TJOB_JSValue);
|
||||||
|
|
||||||
Type
|
Type
|
||||||
TJobCallbackErrorEvent = Procedure (E : Exception; M : TMethod; H : TJobCallbackHelper; Var ReRaise : Boolean) of Object;
|
TJobCallbackErrorEvent = Procedure (E : Exception; M : TMethod; H : TJobCallbackHelper; Var ReRaise : Boolean) of Object;
|
||||||
TJobCallBackErrorCallback = Procedure (E : Exception; M : TMethod; H : TJobCallbackHelper; Var ReRaise : Boolean);
|
TJobCallBackErrorCallback = Procedure (E : Exception; M : TMethod; H : TJobCallbackHelper; Var ReRaise : Boolean);
|
||||||
@ -1390,6 +1398,32 @@ const
|
|||||||
JOBInvokeNew
|
JOBInvokeNew
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Procedure DebugObject(aObject : IJSObject);
|
||||||
|
begin
|
||||||
|
__job_debug_object(aObject.GetJSObjectID,0);
|
||||||
|
end;
|
||||||
|
|
||||||
|
Procedure DebugObject(aObject : TJSObject);
|
||||||
|
|
||||||
|
begin
|
||||||
|
__job_debug_object(aObject.GetJSObjectID,0);
|
||||||
|
end;
|
||||||
|
|
||||||
|
Procedure DebugObject(aObject : TJOB_JSValue);
|
||||||
|
|
||||||
|
begin
|
||||||
|
if (aObject is TJOB_Object) then
|
||||||
|
DebugObject(TJOB_Object(aObject).Value)
|
||||||
|
else if aObject is TJOB_String then
|
||||||
|
Writeln(UTF8Encode(TJOB_String(aObject).Value))
|
||||||
|
else if aObject is TJOB_Boolean then
|
||||||
|
Writeln(TJOB_Boolean(aObject).Value)
|
||||||
|
else if aObject is TJOB_Double then
|
||||||
|
Writeln(TJOB_Double(aObject).Value)
|
||||||
|
else
|
||||||
|
Writeln(TJOB_Double(aObject).AsString);
|
||||||
|
end;
|
||||||
|
|
||||||
{$IFDEF VerboseJOB}
|
{$IFDEF VerboseJOB}
|
||||||
function GetVarRecName(vt: word): string;
|
function GetVarRecName(vt: word): string;
|
||||||
begin
|
begin
|
||||||
@ -4341,6 +4375,11 @@ begin
|
|||||||
Result:=JOBCast(Intf);
|
Result:=JOBCast(Intf);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TJSObject.ShowAsDebug;
|
||||||
|
begin
|
||||||
|
DebugObject(Self);
|
||||||
|
end;
|
||||||
|
|
||||||
class function TJSObject.JSClassName : UnicodeString;
|
class function TJSObject.JSClassName : UnicodeString;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
@ -69,6 +69,7 @@ const
|
|||||||
JOBFn_CallbackHandler = 'JOBCallback';
|
JOBFn_CallbackHandler = 'JOBCallback';
|
||||||
JOBFn_SetMemFromArray = 'set_mem_from_object';
|
JOBFn_SetMemFromArray = 'set_mem_from_object';
|
||||||
JOBFn_SetArrayFromMem = 'set_object_from_mem';
|
JOBFn_SetArrayFromMem = 'set_object_from_mem';
|
||||||
|
JOBFn_DebugObject = 'debug_object';
|
||||||
|
|
||||||
JOBArgUndefined = 0;
|
JOBArgUndefined = 0;
|
||||||
JOBArgLongint = 1;
|
JOBArgLongint = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user