[Pas2js] TJSFloat32Array casting
Mattias Gaertner
nc-gaertnma at netcologne.de
Sun May 20 12:38:52 CEST 2018
On Sun, 20 May 2018 15:54:59 +0700
Ryan Joseph <ryan at thealchemistguild.com> wrote:
> Did something change? I just tried this and it didn’t work. Casting “arr” to TJSObject didn’t work either. I could swear that used to work a few days ago. Maybe an overload is missing? If TJSArray = TJSObject then should “array of single” = TJSObject?
>
> var
> arr: array of single;
> begin
>
> TJSFloat32Array.new(TJSArray(arr)); // Incompatible type arg no. 1: Got "TJSArray", expected “TJSArrayBuffer”
I don't see an overload for that TJSArray in TJSFloat32Array. Michael?
> TJSFloat32Array.new(TJSObject(arr)); // Illegal type conversion: "array type" to "class TJSObject”
You can do TJSObject(Pointer(arr)).
I will add the typecasts array to TJSObject and back.
Mattias
More information about the Pas2js
mailing list