[Pas2js] Pas2js 0.9.20

Michael Van Canneyt michael at freepascal.org
Sat May 12 10:32:09 CEST 2018



On Sat, 12 May 2018, Ryan Joseph wrote:

>
>
>> On May 12, 2018, at 2:49 PM, Ryan Joseph <ryan at thealchemistguild.com> wrote:
>> 
>> That would help and be nice but lots of working making overloads though and it’s possible we’re enforcing type safety where there shouldn’t be. You may very well be able to pass an array of ints to a Float32Array for example.
>
> btw could JSValue be used for generic type comparison and help bridge with JavaScript? I tried:
>
> if i = JSValue then
>
> but I got a syntax error. I thought JSValue would compare to any compiler type but maybe not. The reason I ask is because we could then do “array of JSValue” in TJSTypedArray.

You must typecast a JSValue.

if i = Integer(JSValue) then

I believe only for pointer types (classes) the typecast is unnecessary,
Mattias should confirm this.

Michael.


More information about the Pas2js mailing list