[Pas2js] Question regarding the future type helper feature
Michael Van Canneyt
michael at freepascal.org
Sat Jan 5 10:52:47 CET 2019
On Sat, 5 Jan 2019, Sven Barth via Pas2js wrote:
>>> 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.
The last one in scope should be called, no ?
As far as I can see this does mean you must have some restrictions:
if there are 2 type helpers for a type in one unit (something which I would
forbid anyway), they cannot contain a method with the same signature.
But if they are in 2 separate units, the one from the last unit in the uses
clause must be used, just as for regular procedures. The same rules apply, I
would think.
Michael.
More information about the Pas2js
mailing list