Description
When a TypedArray has an element size that does not evenly divide its underlying buffer (because of e.g. resize), byteLength incorrectly includes the excess bytes.
byteLength is specified to depend upon TypedArrayByteLength, which for a resizable buffer returns elementLength × elementSize (where elementLength comes from TypedArrayLength as floor((byteLength - byteOffset) / elementSize), i.e. the integer number of complete TypedArray elements that can fit in the buffer).
Environment: XS 15.5.1, slot 32 bytes, ID 4 bytes
Description When a TypedArray has an element size that does not evenly divide its underlying buffer (because of e.g. resize),
byteLength
incorrectly includes the excess bytes.Steps to Reproduce
Actual behavior
(little-endian)
Expected behavior
byteLength
is specified to depend upon TypedArrayByteLength, which for a resizable buffer returns elementLength × elementSize (where elementLength comes from TypedArrayLength asfloor((byteLength - byteOffset) / elementSize)
, i.e. the integer number of complete TypedArray elements that can fit in the buffer).test262 pull request: https://github.com/tc39/test262/pull/4199