[Pas2js] Pas2js fails to produce valid code for default constructor expressed with empty parentheses...

Michael Van Canneyt michael at freepascal.org
Fri Jul 20 11:14:59 CEST 2018


Hi,

Please keep your test projects as small as possible. It's difficult to see
where the actual issue is because of all the extra code in your project.

The following minimal project demonstrates the issue:

{$mode objfpc}
program ta;

Var
   a : TObject;

begin
   a:=TObject.Create;
end.

I tested a version with the () and without, and there is indeed a difference:

With parenthesis:

     $mod.a = pas.System.TObject.$create();

Without parenthesis:
     $mod.a = pas.System.TObject.$create("Create");

So there is indeed a bug. Mattias, any idea ?

Michael.

>> Per the attached project which tests default creation of a TObject,
>> TStringList and TWebDataModule (each with and without empty parentheses),
>> this issue has been confirmed on the latest versions of Chrome and FireFox
>> running on Windows 10. As "Create( );" is indeed valid Pascal code and not
>> to antagonize those Pascal language purists (like me ;-) who hate to chase
>> such non-obvious YET seriously annoying bugs, this issue should be fixed
>> soon (please).
>>
>> Appreciatively,
>>
>> J Ralston
>> Frameworks
>>
>


More information about the Pas2js mailing list