* Remove some useless warnings

This commit is contained in:
Michaël Van Canneyt 2024-04-10 10:31:18 +02:00
parent 3cae3e7e48
commit 9f72de4276
2 changed files with 17 additions and 4 deletions

View File

@ -650,6 +650,18 @@ procedure TBaseWebIDLToPas.EnsureUniqueNames(ML: TIDLDefinitionList);
Var
L: TFPObjectHashTable;
Function CanRename(Def: TIDLDefinition) : Boolean;
var
isStringifier : Boolean;
IsIterable : Boolean;
begin
IsStringifier:=(Def.Name='') and (Def is TIDLAttributeDefinition) and (aoStringifier in TIDLAttributeDefinition(Def).Options);
isIterable:=(Def is TIDLIterableDefinition);
Result:=not (IsStringifier or isIterable);
end;
Procedure CheckRename(Def: TIDLDefinition);
var
@ -701,10 +713,10 @@ begin
L:=TFPObjectHashTable.Create(False);
try
For D in ML Do
if not (D is TIDLConstDefinition) then
if CanRename(D) and not (D is TIDLConstDefinition) then
CheckRename(D);
For D in ML Do
if (D is TIDLConstDefinition) then
if CanRename(D) and(D is TIDLConstDefinition) then
CheckRename(D);
finally
L.Free;

View File

@ -1254,9 +1254,10 @@ var
AttrType: TIDLDefinition;
begin
if aParent=nil then ;
if Attr.AttributeType=nil then
if (Attr.AttributeType=nil) then
begin
writeln('Note: skipping field "'+Attr.Name+'" without type at '+GetDefPos(Attr));
if not (aoStringifier in Attr.Options) then
writeln('Note: skipping field "'+Attr.Name+'" without type at '+GetDefPos(Attr));
exit;
end;
PropName:=GetName(Attr);