Browse Source

webidl: nicer local var names

mattias 3 years ago
parent
commit
92944e7b5e
2 changed files with 5 additions and 1 deletions
  1. 2 1
      packages/webidl/src/webidltopas.pp
  2. 3 0
      packages/webidl/src/webidltopas2js.pp

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

@@ -460,6 +460,7 @@ Var
 
 begin
   Result:=True;
+  if aDict=nil then ;
   N:=GetName(aField);
   TN:=GetTypeName(aField.MemberType);
   if TN='record' then
@@ -612,7 +613,7 @@ var
       ArgName:=GetName(Arg);
       if ArgName[1]<>'a' then
         begin
-        ArgName:='a'+ArgName;
+        ArgName:='a'+Uppercase(ArgName[1])+copy(ArgName,2,length(ArgName));
         (Arg.Data as TPasData).PasName:=ArgName;
         end;
       repeat

+ 3 - 0
packages/webidl/src/webidltopas2js.pp

@@ -167,6 +167,7 @@ Var
 
 begin
   Result:=True;
+  if aParent=nil then ;
   Suff:='';
   RT:='';
   if not (foConstructor in aDef.Options) then
@@ -214,6 +215,7 @@ Var
 
 begin
   Result:=0;
+  if aParent=nil then ;
   For D in aList do
     if (D is TIDLAttributeDefinition) then
       if (aoReadOnly in A.Options) then
@@ -293,6 +295,7 @@ Var
 
 begin
   Result:=True;
+  if aParent=nil then ;
   N:=GetName(aAttr);
   PN:=N;
   TN:=GetTypeName(aAttr.AttributeType);