[Pas2js] Random bugs and observations

Michael Van Canneyt michael at freepascal.org
Fri May 11 09:20:58 CEST 2018



On Fri, 11 May 2018, Mattias Gaertner wrote:

> On Fri, 11 May 2018 12:23:03 +0700
> Ryan Joseph <ryan at thealchemistguild.com> wrote:
>
> 
>> 9) bytes is TJSUInt8Array but can’t be passed to a method expecting TJSBufferSource even though it’s a subclass of TJSBufferSource. Casting to TJSBufferSource doesn’t work either and gives nonsensical message.
>> 	gl.bufferData(gl.ARRAY_BUFFER, bytes, gl.STATIC_DRAW);
>
> Report bug.

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.

I will need some time to fix this properly.

Michael.


More information about the Pas2js mailing list