Explorar o código

webidl: add const modifier to function def arguments

mattias %!s(int64=3) %!d(string=hai) anos
pai
achega
bbda3631fa
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      packages/webidl/src/webidltopas.pp

+ 4 - 2
packages/webidl/src/webidltopas.pp

@@ -942,7 +942,7 @@ function TBaseWebIDLToPas.GetArguments(aList: TIDLDefinitionList;
   ForceBrackets: Boolean): String;
 
 Var
-  I: TIDLDefinition;
+  I, Def: TIDLDefinition;
   A: TIDLArgumentDefinition absolute I;
   Arg, aTypeName: string;
 
@@ -953,7 +953,9 @@ begin
     Arg:=GetName(A);
     aTypeName:=GetTypeName(A.ArgumentType);
     Arg:=Arg+': '+aTypeName;
-    if SameText(aTypeName,'UnicodeString') then
+    Def:=FindGlobalDef(A.ArgumentType.TypeName);
+    if (Def is TIDLFunctionDefinition)
+        or SameText(aTypeName,'UnicodeString') then
       Arg:='const '+Arg;
     if Result<>'' then
       Result:=Result+'; ';