Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: respect input offset and bytelength when storing data views
If the incoming data view does not span the entire backing array buffer, copy the data into a smaller block. Data views, like JS Typed Arrays (`Uint8Array` et al) and `DataView`, store a `byteOffset` and `byteLength` field which give them a window onto the bytes stored in an `ArrayBuffer`. We had been ignoring this when storing `Uint8Array` values -- we grabbed the backing buffer directly to store as a block. In the future we could store that windowing data on the `Block` class, but that would be a more involved change for background thread contexts. We'd have to convey that windowing information down to the backing thread. Fixes #81.
- Loading branch information