Browse Source

webidl: skip proc type property

mattias 3 years ago
parent
commit
b47588b088
1 changed files with 10 additions and 3 deletions
  1. 10 3
      packages/webidl/src/webidltowasmjob.pp

+ 10 - 3
packages/webidl/src/webidltowasmjob.pp

@@ -763,7 +763,9 @@ begin
   AttrType:=GetResolvedType(Attr.AttributeType,AttrTypeName,AttrResolvedTypeName);
   AttrType:=GetResolvedType(Attr.AttributeType,AttrTypeName,AttrResolvedTypeName);
 
 
   if AttrType is TIDLInterfaceDefinition then
   if AttrType is TIDLInterfaceDefinition then
-    AttrTypeName:=GetPasIntfName(AttrType);
+    AttrTypeName:=GetPasIntfName(AttrType)
+  else if AttrType is TIDLFunctionDefinition then
+    exit;
   AddLn('function '+FuncName+': '+AttrTypeName+';');
   AddLn('function '+FuncName+': '+AttrTypeName+';');
 
 
   if Data.GetterBody<>'' then exit;
   if Data.GetterBody<>'' then exit;
@@ -819,7 +821,9 @@ begin
   FuncName:=SetterPrefix+GetName(Attr);
   FuncName:=SetterPrefix+GetName(Attr);
   AttrType:=GetResolvedType(Attr.AttributeType,AttrTypeName,AttrResolvedTypeName);
   AttrType:=GetResolvedType(Attr.AttributeType,AttrTypeName,AttrResolvedTypeName);
   if AttrType is TIDLInterfaceDefinition then
   if AttrType is TIDLInterfaceDefinition then
-    AttrTypeName:=GetPasIntfName(AttrType);
+    AttrTypeName:=GetPasIntfName(AttrType)
+  else if AttrType is TIDLFunctionDefinition then
+    exit;
 
 
   AddLn('procedure '+FuncName+'(const aValue: '+AttrTypeName+');');
   AddLn('procedure '+FuncName+'(const aValue: '+AttrTypeName+');');
 
 
@@ -876,7 +880,10 @@ begin
   Code:='property '+PropName+': '+AttrTypeName+' read '+GetterPrefix+PropName;
   Code:='property '+PropName+': '+AttrTypeName+' read '+GetterPrefix+PropName;
   if not (aoReadOnly in Attr.Options) then
   if not (aoReadOnly in Attr.Options) then
     Code:=Code+' write '+SetterPrefix+PropName;
     Code:=Code+' write '+SetterPrefix+PropName;
-  AddLn(Code+';');
+  Code:=Code+';';
+  if AttrType is TIDLFunctionDefinition then
+    Code:='// '+Code;
+  AddLn(Code);
   Result:=true;
   Result:=true;
 end;
 end;