Browse Source

webidl: wasmjob: skip getter

mattias 3 years ago
parent
commit
e660f2ea84
2 changed files with 8 additions and 6 deletions
  1. 0 4
      packages/webidl/src/webidlparser.pp
  2. 8 2
      packages/webidl/src/webidltowasmjob.pp

+ 0 - 4
packages/webidl/src/webidlparser.pp

@@ -1795,10 +1795,6 @@ begin
     for i:=0 to List.Count-1 do
       begin
       Top:=TTopologicalIntf(List[i]);
-      //case Top.Intf.Name of
-      //'EventTarget','AbortSignal':
-      //  writeln('AAA1 TWebIDLContext.GetInterfacesTopologically ',Top.Intf.Name,' parent=',Top.Intf.ParentName,' found=',Top.Parent<>nil,' level=',Top.Level,' srcpos=',Top.SrcPos);
-      //end;
       Result.Add(Top.Intf);
       end;
   finally

+ 8 - 2
packages/webidl/src/webidltowasmjob.pp

@@ -368,8 +368,8 @@ begin
   Result:=0;
   aClassName:=GetName(Intf);
   aPasIntfName:=GetPasIntfName(Intf);
-  AddLn('class function Cast(Intf: IJSObject): '+aPasIntfName+';');
-  Code:='class function '+aClassName+'.Cast(Intf: IJSObject): '+aPasIntfName+';'+sLineBreak;
+  AddLn('function Cast(Intf: IJSObject): '+aPasIntfName+';');
+  Code:='function '+aClassName+'.Cast(Intf: IJSObject): '+aPasIntfName+';'+sLineBreak;
   Code:=Code+'begin'+sLineBreak;
   Code:=Code+'  Result:='+aClassName+'.Cast(Intf);'+sLineBreak;
   Code:=Code+'end;'+sLineBreak;
@@ -431,6 +431,12 @@ Var
 begin
   Result:=True;
   Data:=aDef.Data as TPasDataWasmJob;
+  if Data.PasName='' then
+    begin
+    writeln('Note: skipping Getter of '+aDef.Parent.Name+' at '+GetDefPos(aDef));
+    exit(false);
+    end;
+
   Suff:='';
   RT:='';
   if (foConstructor in aDef.Options) then