From 18a40f92ee349c7030d4c5227c1f95696ac2ffcc Mon Sep 17 00:00:00 2001 From: Henrique Gottardi Werlang Date: Fri, 19 Apr 2024 07:56:26 -0300 Subject: [PATCH] When invoke an asynchronous method, the invoke function return the promise created. --- packages/rtl/src/rtti.pas | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/rtl/src/rtti.pas b/packages/rtl/src/rtti.pas index 3b3f868..90167ff 100644 --- a/packages/rtl/src/rtti.pas +++ b/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;