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

Michael Van Canneyt michael at freepascal.org
Fri Dec 21 19:08:01 CET 2018



On Fri, 21 Dec 2018, silvioprog wrote:

> On Fri, Dec 21, 2018 at 1:54 PM Michael Van Canneyt <michael at freepascal.org>
> wrote:
>
>> Why not simply declare
>>
>> function myfoo: string; varargs;external name 'foo';
>>
>
> well, it is not a variadic situation, because the arguments must be named.
> However, ...
>
> Because if you declare all arguments as jsvalue, it makes no sense to
>> create all
>> overloads, there is no type checking.
>
>
> ... I agree about this above, and I've used the varargs facility.
>
> Anyway, it would be nice such feature like this, but at this moment I can't
> get an idea of a possible pascal-ish syntax. :-/ So a compiler option would
> be welcome, allowing "omit default parameters". E.g:

I think that should be possible, but only for external functions.

Michael.


More information about the Pas2js mailing list