mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2026-01-04 15:00:53 +01:00
* Correctly create constructor definitions
This commit is contained in:
parent
3075a820a1
commit
23bcb38138
@ -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
|
||||
|
||||
@ -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;',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user