[Pas2js] Question regarding the future type helper feature

Sven Barth pascaldragon at googlemail.com
Sat Jan 5 10:09:38 CET 2019


Am 04.01.2019 um 20:07 schrieb Michael Van Canneyt:
>
>
> On Fri, 4 Jan 2019, silvioprog wrote:
>
>> Hello,
>>
>> Since this feature is planned to be implemented, I have a question about
>> the possibility to declare multiple helpers for the same type. I suspect
>> you will implement it extending the object prototype, but it seems 
>> multiple
>> type helpers are not allowed in Pascal code. For example, consider the
>> following code:
>>
>
> [snip]
>
>> it prints:
>>
>> Tue Aug 19 1975 23:15:30 GMT-0300 ; My Tue Aug 19 1975 23:15:30 GMT-0300
>>
>> Many JS plugins works extending prototype, and we can use multiple 
>> plugins
>> simultaneously, so it should be supported in Pas2JS mode. :-)
>
> I had thought of this myself already. If possible, we will do it.
Ryan had published a patch on one of the fpc mailing lists for FPC for 
this specific feature and I myself wanted that in FPC as well. So it's 
likely that this gets added to FPC as well - we should only make sure 
then that the same methods are called when there is an ambiguity.

Regards,
Sven


More information about the Pas2js mailing list