[Pas2js] Subclassing TJSArray

Mattias Gaertner nc-gaertnma at netcologne.de
Sat May 12 10:58:06 CEST 2018


On Sat, 12 May 2018 08:17:48 +0700
Ryan Joseph <ryan at thealchemistguild.com> wrote:

> > On May 11, 2018, at 11:18 PM, Mattias Gaertner <nc-gaertnma at netcologne.de> wrote:
> > 
> > A Pascal class cannot be created with the JS 'new' operator, as it
> > does not have a prototype. I added an error message.  
> 
> I also tried to use TVec2.from() to construct the array but:
> 
> 1) -dJAVASCRIPT2015 didn’t define the symbol which from() requires

Works here.
Use -vc to see conditionals.

> 2) .from() return a TJSArray instead of the subclass TVec2

Yes.


> 3) I think I read that implicit arrays aren’t supported yet but TVec2.from([0, 0]) didn’t work.

Yes. It's on my todo list. FPC got them last year from Sven.

Mattias


More information about the Pas2js mailing list