Explorar el Código

webidl: add const modifier to function def arguments

mattias hace 3 años
padre
commit
bbda3631fa
Se han modificado 1 ficheros con 4 adiciones y 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+'; ';