[Pas2js] function returning: short implementations

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Dec 13 14:54:33 CET 2018


On Thu, 13 Dec 2018 06:33:50 -0700 (MST)
warleyalex via Pas2js <pas2js at lists.freepascal.org> wrote:

>[...]
> this.CreateHandleElement = function () {
>   var Result = null;
>   Result = document.createElement("IMG");
>   return Result;
> };
> 
> I propose that this be made possible using for direct JS
> implementation without the intermediary Result variable.
> 
> this.CreateHandleElement = function () {  
>   return document.createElement("IMG");  
> };

Yes, pas2js has currently almost no optimizations. The priorities are
still getting more language features.
Note that the above is done by a good minifier:
http://wiki.freepascal.org/pas2js_minifier

Mattias


More information about the Pas2js mailing list