[Pas2js] Possible feature? keep the original JS overload behavior

silvioprog silvioprog at gmail.com
Fri Dec 21 22:06:47 CET 2018


On Fri, Dec 21, 2018 at 5:39 PM Mattias Gaertner via Pas2js <
pas2js at lists.freepascal.org> wrote:

> The Delphi IDE barks on that. And Lazarus needs to be adapted too.
>

Delphi IDE barks about external, JSValue, $PUSH, but it compiles using
pas2js, so I've used them even so hehe. Please take a look at attached
pictures (sorry for attaching them, but I need to show the IDE errors).
Notice all lines the IDE marked as red. And the "Structures" window goes
crazy.


> Maybe better "misuse" a calling convention like stdcall?
>

Hm... maybe *cdecl*, since it sounds like "the original parameter order
will be kept". :-)

> Note: since the 'nodefaults' was defined to 'bar', you can declare
> > default params using the short way "a,b: integer = 0" or the verbose
> > one "a: integer = 0; b: integer = 0".
>
> The modifier is read *after* parsing the parameter list.
>

Very interesting. I'll study the compiler internals as soon as possible.
Thanks for sharing this info.

Breaking the rule of one param per default value is a different topic.


Agreed.

-- 
Silvio Clécio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/pas2js/attachments/20181221/282c6e7e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic01.png
Type: image/png
Size: 11258 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/pas2js/attachments/20181221/282c6e7e/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic02.png
Type: image/png
Size: 55826 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/pas2js/attachments/20181221/282c6e7e/attachment-0003.png>


More information about the Pas2js mailing list