Unit MyTest;
procedure Run; async;
begin
// do something...
end;
begin
run()._then(function (a : jsvalue) : jsvalue
begin
end);
end.In the line "run()._then(function (a : jsvalue) : jsvalue” give me the error “Error: illegal qualifier "." after " run():Procedure/Function"”
De: <mailto:>
Enviado:terça-feira, 1 de junho de 2021 07:00
Para: <mailto:>
Assunto: Pas2js Digest, Vol 39, Issue 1
Send Pas2js mailing list submissions to
To subscribe or unsubscribe via the World Wide Web, visit https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freepascal.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fpas2js&data=04%7C01%7C%7C993164b4dd5f46e3f56e08d924e407ad%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637581384059437072%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=CVena48XVFUyhZ5NC8ajTNY%2BQa8uyZIJuChX%2FCA3p2Q%3D&reserved=0 or, via email, send a message with subject or body 'help' to
You can reach the person managing the list at
When replying, please edit your Subject line so it is more specific than "Re: Contents of Pas2js digest..."
Today's Topics:
1. Async procedure. (Henrique Gottardi Werlang)
2. Re: Async procedure. (Michael Van Canneyt)
----------------------------------------------------------------------
Message: 1
Date: Mon, 31 May 2021 18:18:34 +0000
From: Henrique Gottardi Werlang
To: ""
Subject: [Pas2js] Async procedure.
Message-ID:
Content-Type: text/plain; charset="windows-1252"
I'm making a remote request client and I had a problem.
I declared an asynchronous procedure, but it doesn't generate a promise.
This I can't register the "then” event.
Is it possible to modify this procedure behavior?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.freepascal.org%2Fpipermail%2Fpas2js%2Fattachments%2F20210531%2F05d3a71c%2Fattachment-0001.htm&data=04%7C01%7C%7C993164b4dd5f46e3f56e08d924e407ad%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637581384059437072%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=%2Bwr%2BjFmCBrl8KBdOUlarJQrb4KLS9Qqk6R%2FOIxt9XMY%3D&reserved=0>
------------------------------
Message: 2
Date: Mon, 31 May 2021 21:06:32 +0200 (CEST)
From: Michael Van Canneyt
To: pas2js discussions
Subject: Re: [Pas2js] Async procedure.
Message-ID: <alpine.DEB.2.22.394.2105312102530.1614564 at home> Content-Type: text/plain; charset="windows-1252"; Format="flowed"
Henrique Gottardi Werlang wrote 5 lines
Works fine here:
uses JS;
function Run: word; async;
begin
Result:=3;
end;
begin
run()._then(function (a : jsvalue) : jsvalue
begin
end);
end.or
uses JS;
function Run: word; async;
begin
Result:=3;
end;
var
p: TJSPromise;
begin
p:=Run(); // calling directly without await() returns a TJSPromise!
p._then(function (a : jsvalue) : jsvalue
begin
end);
end.So what does not work for you ?
Michael.
------------------------------
Subject: Digest Footer
