-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Description
Here's a minimal example:
arr :: DataView
arr = whole (fromArray [12.0, 23.0, 53.0, 0.0]) -- we need one number for each byte
getUint32le arr 0 -- Just 3479308u
getUint32le (dataView (asUint32Array arr)) 0 -- runtime exception - cannot read property `call` of undefined
I noticed that the implementation for fromArray
simply builds it out of a Uint8Array
, where each Number
is one byte. However, asUint32Array
builds a new typed array using the previous buffer. I wonder if there's just some faulty logic going on bit-wise in regards to the buffer offset or bytelength or something. If this library is no longer being maintained, I might redesign some of it if that's alright - I'm probably not gonna touch the type designs you have, but I might make the actual functions a little more true to the js api.
Thanks for making this regardless!
Metadata
Metadata
Assignees
Labels
No labels