Просмотр исходного кода

When invoke an asynchronous method, the invoke function return the promise created.

Henrique Gottardi Werlang 1 год назад
Родитель
Сommit
18a40f92ee
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      packages/rtl/src/rtti.pas

+ 2 - 0
packages/rtl/src/rtti.pas

@@ -1951,6 +1951,8 @@ begin
 
   if Assigned(ReturnType) then
     TValue.Make(ReturnValue, ReturnType.Handle, Result)
+  else if IsAsyncCall then
+    TValue.Make(ReturnValue, TypeInfo(TJSPromise), Result)
   else if IsConstructor then
     TValue.Make(ReturnValue, Instance.TypeInfo, Result)
 end;