* Take into account element length, not byte length

This commit is contained in:
Michael Van Canneyt 2025-02-06 16:13:55 +01:00
parent bc95a7dc7f
commit 00496e7bcc

View File

@ -1501,7 +1501,7 @@ var
begin
if HaveSharedArrayBuffer and (aArray.bufferObj is TJSSharedArrayBuffer) then
begin
Buf:=TJSSharedArrayBuffer(aArray.bufferObj).slice(aArray.byteOffset,aArray.byteLength);
Buf:=TJSSharedArrayBuffer(aArray.bufferObj).slice(aArray.byteOffset,aArray.byteOffset+aArray.ByteLength);
if aWordSized then
Result:=TJSUInt16Array.New(SharedToNonShared(Buf))
else