[Pas2js] Pas2js 0.9.20

Michael Van Canneyt michael at freepascal.org
Sat May 12 10:49:06 CEST 2018



On Sat, 12 May 2018, Ryan Joseph wrote:

>
>
>> On May 12, 2018, at 3:37 PM, Michael Van Canneyt <michael at freepascal.org> wrote:
>> 
>> Added in rev. 98 for _set.
>> 
>> Please test and let me know if you think something is missing.
>> 
>
> Thanks. I just added some myself but I’ll take them out.
>
> Another closely related thing I just encountered:
>
> floatBuffer := TJSFloat32Array.New(byteBuffer.buffer, 0, 16 / 4); // Incompatible type arg no. 3: Got "Double", expected “NativeInt"
>
> What is NativeInt exactly? 16 / 4 should be valid for that parameter right?

The last parameter is a length. How a length can be a float is not clear to me :)

So, no. NativeInt is an integer. It is not 64 bit, but 52/53 bits.

Pascal rules apply, meaning that the result of / is a float.
You must use 16 div 4 if you want an integer result.

Michael.


More information about the Pas2js mailing list