[Pas2js] Random bugs and observations

Ryan Joseph ryan at thealchemistguild.com
Fri May 11 09:33:27 CEST 2018



> On May 11, 2018, at 2:20 PM, Michael Van Canneyt <michael at freepascal.org> wrote:
> 
> I looked into this. Strictly speaking this is an error in the translation.
> 
> This is difficult to translate to pascal.
> 
> BufferSource is actually a TJSTypedArray or a TJSArrayBuffer:
> 
> https://developer.mozilla.org/en-US/docs/Web/API/BufferSource
> 
> Which means that in fact for any function that accepts a BufferSource
> argument, I should define 2 overloads, one with TJSTypedArray, one with
> TJSArrayBuffer.

But Float32Array -> TypedArray -> BufferSource right? gl.bufferData wants TJSBufferSource so shouldn’t Float32Array work? I had this problem other times with other classes. Unless polymorphism doesn’t work the same in JS...

Regards,
	Ryan Joseph



More information about the Pas2js mailing list