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

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Dec 24 23:01:54 CET 2018


On Fri, 21 Dec 2018 22:50:01 +0100 (CET)
Michael Van Canneyt <michael at freepascal.org> wrote:

>[...]
> > Why forbid it for Pascal functions?  
> The purpose of pas2js is to allow pascal to run in the browser. 
> The purpose is not to make pascal behave like Javascript. 
> I want to bend Javascript, not bend pascal. So if we really must bend
> pascal to accomodate interaction with external JS code, 
> I prefer it limited to that use case alone :-)

Good point.

In that case the default value is not needed and syntax could be:

procedure f(w: jsvalue = JSOmitArg); external name 'f';

where JSOmitArg is a special value that is omitted.
Advantage: no need to adapt Delphi/Lazarus.

Mattias


More information about the Pas2js mailing list