[Pas2js] Subclassing TJSArray

Mattias Gaertner nc-gaertnma at netcologne.de
Fri May 11 18:18:46 CEST 2018


On Fri, 11 May 2018 16:47:49 +0700
Ryan Joseph <ryan at thealchemistguild.com> wrote:

> I was curious if I could subclass an array without it being external but I got a compile error as seen below.
> [...]
> v := TVec2.new(2);

A Pascal class cannot be created with the JS 'new' operator, as it
does not have a prototype. I added an error message.

I guess it is possible to descend from JS Array. A quick check revealed
that the length property is read only, while in a simple example it
works. I wonder what is the difference.

Mattias



More information about the Pas2js mailing list