diff options
author | Linus Groh <mail@linusgroh.de> | 2021-05-21 19:29:05 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-05-21 19:29:23 +0100 |
commit | 3a4cbbf01c63ab70eff57275bf45bccefb26555f (patch) | |
tree | de8b8113679611dc09032c1708d6ea4530dd6a11 /Tests | |
parent | 9003dd907e795b956538be6b76c2729bf01ceb14 (diff) | |
download | serenity-3a4cbbf01c63ab70eff57275bf45bccefb26555f.zip |
LibJS: Fix indexed access of TypedArray with byte offset
By doing the offset calculation in {get,put}_by_index() we would
delegate these operations to Object for any index >= (array length -
byte offset). By doing the offset calculation in data() instead, we can
just use the unaltered property index for indexing the returned Span.
In other words: data()[0] now returns the same value as indexing the
TypedArray at index 0 in JS.
This also fixes a bug in the js REPL which would not consider the byte
offset and subsequently access the underlying ArrayBuffer data with a
wrong index.
Diffstat (limited to 'Tests')
0 files changed, 0 insertions, 0 deletions