* Correctly create constructor definitions

This commit is contained in:
Michaël Van Canneyt 2024-04-09 17:04:09 +02:00
parent 3075a820a1
commit 23bcb38138
2 changed files with 3 additions and 2 deletions

View File

@ -598,6 +598,7 @@ begin
InvokeName:= 'InvokeJSObjectResult';
ResolvedReturnTypeName:=aParent.Name;
ReturnTypeName:=GetName(aParent);
InvokeClassName:=ReturnTypeName;
exit(Nil);
end
else
@ -739,7 +740,7 @@ begin
Args:=',['+Args+']';
if foConstructor in aDef.Options then
InvokeCode:=InvokeCode+InvokeName+'('''+ResolvedReturnTypeName+''''+Args+','+ReturnTypeName
InvokeCode:=InvokeCode+InvokeName+'('''+ResolvedReturnTypeName+''''+Args
else
InvokeCode:=InvokeCode+InvokeName+'('''+aDef.Name+''''+Args;
if InvokeClassName<>'' then

View File

@ -818,7 +818,7 @@ begin
'',
'class function TJSAttr.Create(aOptions: Integer) : TJSAttr;',
'begin',
' Result:=InvokeJSObjectResult(''Attr'',[aOptions],TJSAttr);',
' Result:=InvokeJSObjectResult(''Attr'',[aOptions],TJSAttr) as TJSAttr;',
'end;',
'',
'class function TJSAttr.Cast(const Intf: IJSObject): IJSAttr;',