mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-08-21 10:09:17 +02:00
Changed invoke implementation to the range check error don't try to check the range of a parameter that is not an array, but one class.
This commit is contained in:
parent
af3397e42c
commit
32a78bc897
@ -494,7 +494,7 @@ type
|
|||||||
EInvoke = EJS;
|
EInvoke = EJS;
|
||||||
|
|
||||||
TVirtualInterfaceInvokeEvent = reference to procedure(Method: TRttiMethod; const Args: specialize TArray<TValue>; out Result: TValue);
|
TVirtualInterfaceInvokeEvent = reference to procedure(Method: TRttiMethod; const Args: specialize TArray<TValue>; out Result: TValue);
|
||||||
TVirtualInterfaceInvokeEventJS = reference to function(const aMethodName: String; const Args: TJSValueDynArray): JSValue;
|
TVirtualInterfaceInvokeEventJS = reference to function(const MethodName: String; const Args: TJSFunctionArguments): JSValue;
|
||||||
|
|
||||||
{ TVirtualInterface: A class that can implement any IInterface. Any method
|
{ TVirtualInterface: A class that can implement any IInterface. Any method
|
||||||
call is handled by the OnInvoke event. }
|
call is handled by the OnInvoke event. }
|
||||||
@ -505,7 +505,7 @@ type
|
|||||||
FOnInvoke: TVirtualInterfaceInvokeEvent;
|
FOnInvoke: TVirtualInterfaceInvokeEvent;
|
||||||
FOnInvokeJS: TVirtualInterfaceInvokeEventJS;
|
FOnInvokeJS: TVirtualInterfaceInvokeEventJS;
|
||||||
|
|
||||||
function Invoke(const MethodName: String; const Args: TJSValueDynArray): JSValue;
|
function Invoke(const MethodName: String; const Args: TJSFunctionArguments): JSValue;
|
||||||
public
|
public
|
||||||
constructor Create(PIID: PTypeInfo); overload;
|
constructor Create(PIID: PTypeInfo); overload;
|
||||||
constructor Create(PIID: PTypeInfo; const InvokeEvent: TVirtualInterfaceInvokeEvent); overload;
|
constructor Create(PIID: PTypeInfo; const InvokeEvent: TVirtualInterfaceInvokeEvent); overload;
|
||||||
@ -2253,7 +2253,7 @@ begin
|
|||||||
Result := inherited QueryInterface(iid, obj);
|
Result := inherited QueryInterface(iid, obj);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TVirtualInterface.Invoke(const MethodName: String; const Args: TJSValueDynArray): JSValue;
|
function TVirtualInterface.Invoke(const MethodName: String; const Args: TJSFunctionArguments): JSValue;
|
||||||
var
|
var
|
||||||
Method: TRttiMethod;
|
Method: TRttiMethod;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user