Browse Source

webidl: wasmjob: started return type array

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

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

@@ -381,7 +381,7 @@ Var
   I: Integer;
   I: Integer;
   AddFuncBody: Boolean;
   AddFuncBody: Boolean;
   ArgDefList: TIDLDefinitionList;
   ArgDefList: TIDLDefinitionList;
-  CurDef, ArgType: TIDLDefinition;
+  CurDef, ArgType, ReturnDef: TIDLDefinition;
   ArgDef: TIDLArgumentDefinition absolute CurDef;
   ArgDef: TIDLArgumentDefinition absolute CurDef;
 begin
 begin
   Result:=True;
   Result:=True;
@@ -414,8 +414,10 @@ begin
       InvokeName:='InvokeJSNoResult';
       InvokeName:='InvokeJSNoResult';
       end;
       end;
     else
     else
-      InvokeName:='InvokeJSObjectResult';;
-      RT:=ClassToPasIntfName(RT);
+      InvokeName:='InvokeJSObjectResult';
+      ReturnDef:=FindGlobalDef(aDef.ReturnType.TypeName);
+      if ReturnDef is TIDLInterfaceDefinition then
+        RT:=ClassToPasIntfName(RT);
     end;
     end;
 
 
     end;
     end;