[Pas2js] RES: Pas2js Digest, Vol 39, Issue 1
Henrique Gottardi Werlang
henriquewerlang at hotmail.com
Tue Jun 1 12:33:08 CEST 2021
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: pas2js-request at lists.freepascal.org<mailto:pas2js-request at lists.freepascal.org>
Enviado:terça-feira, 1 de junho de 2021 07:00
Para: pas2js at lists.freepascal.org<mailto:pas2js at lists.freepascal.org>
Assunto: Pas2js Digest, Vol 39, Issue 1
Send Pas2js mailing list submissions to
pas2js at lists.freepascal.org
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
pas2js-request at lists.freepascal.org
You can reach the person managing the list at
pas2js-owner at lists.freepascal.org
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 <henriquewerlang at hotmail.com>
To: "pas2js at lists.freepascal.org" <pas2js at lists.freepascal.org>
Subject: [Pas2js] Async procedure.
Message-ID:
<CP4P284MB0994AF032625620A0E1D1FD2B23F9 at CP4P284MB0994.BRAP284.PROD.OUTLOOK.COM>
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 <michael at freepascal.org>
To: pas2js discussions <pas2js at lists.freepascal.org>
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"
On Mon, 31 May 2021, Henrique Gottardi Werlang wrote:
> 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.
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
_______________________________________________
Pas2js maillist - Pas2js at lists.freepascal.org
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
------------------------------
End of Pas2js Digest, Vol 39, Issue 1
*************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/pas2js/attachments/20210601/0dc77c80/attachment.htm>
More information about the Pas2js
mailing list