[Pas2js] How to access a private field (avoiding JS)?
Mattias Gaertner
nc-gaertnma at netcologne.de
Sat Jan 12 10:29:02 CET 2019
On Fri, 11 Jan 2019 23:00:12 -0300
silvioprog <silvioprog at gmail.com> wrote:
> On Fri, Jan 11, 2019 at 6:38 PM Mattias Gaertner via Pas2js <
> pas2js at lists.freepascal.org> wrote:
> [...]
>
> > For example:
> > TJSObject(Result)['FOwner']:=AOwner;
> >
> > Mattias
> >
>
> OMG, so simple. 😮 I didn't know that Properties[] could access
> private fields.
The external classes gives you direct JS access. You can
access any JS property, even if it does not exist.
You can add new properties or test if they exist. That's why the
compiler cannot and does not check it.
Mattias
More information about the Pas2js
mailing list