mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-08-23 14:39:08 +02:00
Validating the interface type in the virtual interface class.
This commit is contained in:
parent
5f5e39c1f6
commit
af3397e42c
@ -2210,16 +2210,21 @@ begin
|
|||||||
InterfaceMaps := TJSObject.New;
|
InterfaceMaps := TJSObject.New;
|
||||||
FInterfaceType := FContext.GetType(PIID) as TRttiInterfaceType;
|
FInterfaceType := FContext.GetType(PIID) as TRttiInterfaceType;
|
||||||
|
|
||||||
InterfaceInfo := FInterfaceType.InterfaceTypeInfo;
|
if Assigned(FInterfaceType) then
|
||||||
|
|
||||||
while Assigned(InterfaceInfo) do
|
|
||||||
begin
|
begin
|
||||||
InterfaceMaps[InterfaceInfo.InterfaceInfo.GUID] := GenerateNewMap(InterfaceInfo);
|
InterfaceInfo := FInterfaceType.InterfaceTypeInfo;
|
||||||
|
|
||||||
InterfaceInfo := InterfaceInfo.Ancestor;
|
while Assigned(InterfaceInfo) do
|
||||||
end;
|
begin
|
||||||
|
InterfaceMaps[InterfaceInfo.InterfaceInfo.GUID] := GenerateNewMap(InterfaceInfo);
|
||||||
|
|
||||||
JSThis['$intfmaps'] := InterfaceMaps;
|
InterfaceInfo := InterfaceInfo.Ancestor;
|
||||||
|
end;
|
||||||
|
|
||||||
|
JSThis['$intfmaps'] := InterfaceMaps;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
raise EInvalidCast.Create;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TVirtualInterface.Create(PIID: PTypeInfo; const InvokeEvent: TVirtualInterfaceInvokeEvent);
|
constructor TVirtualInterface.Create(PIID: PTypeInfo; const InvokeEvent: TVirtualInterfaceInvokeEvent);
|
||||||
|
Loading…
Reference in New Issue
Block a user