mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 08:49:25 +02:00
Fix for external class declared inside another external class.
This commit is contained in:
parent
6f8fb64d36
commit
9120ef74e5
@ -16343,14 +16343,19 @@ function TPasToJSConverter.ConvertExtClassType(El: TPasClassType;
|
|||||||
// jsclass: "Object"
|
// jsclass: "Object"
|
||||||
// });
|
// });
|
||||||
var
|
var
|
||||||
|
A: Integer;
|
||||||
TIObj: TJSObjectLiteral;
|
TIObj: TJSObjectLiteral;
|
||||||
Call: TJSCallExpression;
|
Call: TJSCallExpression;
|
||||||
TIProp: TJSObjectLiteralElement;
|
TIProp: TJSObjectLiteralElement;
|
||||||
ClassScope: TPas2JSClassScope;
|
ClassScope: TPas2JSClassScope;
|
||||||
AncestorType: TPasClassType;
|
AncestorType: TPasClassType;
|
||||||
aResolver: TPas2JSResolver;
|
aResolver: TPas2JSResolver;
|
||||||
|
St: TJSStatementList;
|
||||||
|
MemberElement: TPasElement;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result:=nil;
|
Result:=nil;
|
||||||
|
|
||||||
if not El.IsExternal then
|
if not El.IsExternal then
|
||||||
RaiseNotSupported(El,AContext,20191027183236);
|
RaiseNotSupported(El,AContext,20191027183236);
|
||||||
|
|
||||||
@ -16387,7 +16392,20 @@ begin
|
|||||||
TIProp:=TIObj.Elements.AddElement;
|
TIProp:=TIObj.Elements.AddElement;
|
||||||
TIProp.Name:=TJSString(GetBIName(pbivnRTTIExtClass_JSClass));
|
TIProp.Name:=TJSString(GetBIName(pbivnRTTIExtClass_JSClass));
|
||||||
TIProp.Expr:=CreateLiteralString(El,TPasClassType(El).ExternalName);
|
TIProp.Expr:=CreateLiteralString(El,TPasClassType(El).ExternalName);
|
||||||
Result:=Call;
|
St:=TJSStatementList(CreateElement(TJSStatementList,El));
|
||||||
|
St.A := Call;
|
||||||
|
Result:=St;
|
||||||
|
|
||||||
|
for A := 0 to Pred(El.Members.Count) do
|
||||||
|
begin
|
||||||
|
MemberElement := El.Members[A];
|
||||||
|
if (MemberElement is TPasClassType) and not (TPasClassType(MemberElement).IsForward) then
|
||||||
|
begin
|
||||||
|
St.B := ConvertExtClassType(TPasClassType(MemberElement), AContext);
|
||||||
|
|
||||||
|
St := St.B as TJSStatementList;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
finally
|
finally
|
||||||
if Result=nil then
|
if Result=nil then
|
||||||
Call.Free;
|
Call.Free;
|
||||||
|
Loading…
Reference in New Issue
Block a user