Open timoxley opened 9 years ago
Hm, the ndarray
readme does say:
array.dtype Returns a string representing the undelying data type of the ndarray. Excluding generic data stores these types are compatible with typedarray-pool.
Perhaps typedarray-pool
should simply accept 'array' as a valid type and return: new Array(n)
.
Thanks @timoxley. I'll take a look at this when I get a chance. Was going to start factoring out dtype operations into separate scijs repos so these things can be tackled consistently. This seems like maybe a straight-up bug though. Seems like that should work… I'll take a look when I get a chance. Thanks for the bug report!
When passing an
ndarray
backed by a vanilla JSArray
, translate will crash with an error "TypeError: Cannot read property 'get' of null".See example below:
Error comes from this line returning
null
:Which seems to occur because
arr.dtype
is 'array' rather than one of the types listed in https://github.com/mikolalysenko/typedarray-pool#poolmallocn-dtype