mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-18 10:49:39 +02:00
webidl: array arg pass as const
This commit is contained in:
parent
f6b5c513bb
commit
bcb5365cca
@ -720,7 +720,7 @@ end;
|
||||
function TBaseWebIDLToPas.GetSequenceTypeName(
|
||||
Seq: TIDLSequenceTypeDefDefinition; ForTypeDef: Boolean): string;
|
||||
begin
|
||||
writeln('TBaseWebIDLToPas.GetSequenceTypeName ',Seq.ElementType.Name,' ',Seq.ElementType.TypeName);
|
||||
//writeln('TBaseWebIDLToPas.GetSequenceTypeName ',Seq.ElementType.Name,' ',Seq.ElementType.TypeName);
|
||||
Result:=GetTypeName(Seq.ElementType,ForTypeDef);
|
||||
if Result='' then
|
||||
raise EConvertError.Create('sequence without name at '+GetDefPos(Seq));
|
||||
@ -806,7 +806,6 @@ begin
|
||||
if ForTypeDef then ;
|
||||
|
||||
Result:=aTypeName;
|
||||
writeln('BBB1 TBaseWebIDLToPas.GetTypeName ',Result);
|
||||
D:=FContext.FindDefinition(Result);
|
||||
if D<>Nil then
|
||||
Result:=GetName(D)
|
||||
@ -984,8 +983,10 @@ begin
|
||||
aTypeName:=GetTypeName(A.ArgumentType);
|
||||
Arg:=Arg+': '+aTypeName;
|
||||
Def:=FindGlobalDef(A.ArgumentType.TypeName);
|
||||
//writeln('TBaseWebIDLToPas.GetArguments Arg="',Arg,'" A.ArgumentType.TypeName=',A.ArgumentType.TypeName,' ',Def<>nil);
|
||||
if (Def is TIDLFunctionDefinition)
|
||||
or (Def is TIDLDictionaryDefinition)
|
||||
or (A.ArgumentType.TypeName='sequence')
|
||||
or SameText(aTypeName,'UnicodeString') then
|
||||
Arg:='const '+Arg;
|
||||
if Result<>'' then
|
||||
|
@ -237,20 +237,18 @@ begin
|
||||
'void': Result:=aTypeName;
|
||||
else
|
||||
Def:=FindGlobalDef(aTypeName);
|
||||
writeln('TWebIDLToPasWasmJob.GetTypeName ',aTypeName,' ',Def<>nil);
|
||||
//writeln('TWebIDLToPasWasmJob.GetTypeName ',aTypeName,' ',Def<>nil);
|
||||
if Def is TIDLSequenceTypeDefDefinition then
|
||||
Result:=GetSequenceTypeName(TIDLSequenceTypeDefDefinition(Def))
|
||||
else
|
||||
begin
|
||||
Result:=inherited GetTypeName(aTypeName,ForTypeDef);
|
||||
writeln('AAA1 TWebIDLToPasWasmJob.GetTypeName Result=',Result);
|
||||
if (Result=aTypeName)
|
||||
and (LeftStr(Result,length(PasInterfacePrefix))<>PasInterfacePrefix)
|
||||
and (RightStr(Result,length(PasInterfaceSuffix))<>PasInterfaceSuffix)
|
||||
then
|
||||
Result:=PasInterfacePrefix+Result+PasInterfaceSuffix;
|
||||
end;
|
||||
writeln('AAA2 TWebIDLToPasWasmJob.GetTypeName Result=',Result);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user