Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

angular.copy doesn't work with typed arrays #10210

Closed
digitalillusion opened this issue Nov 25, 2014 · 3 comments
Closed

angular.copy doesn't work with typed arrays #10210

digitalillusion opened this issue Nov 25, 2014 · 3 comments

Comments

@digitalillusion
Copy link

Hello, please consider the following plunker:

http://plnkr.co/edit/AgjiBp2YtFKt8VfqBosT?p=preview

The call to angular.copy() passing a typed array as parameter throws exception: length method called on incompatible Object at isArrayLike.
Using Firefox 33 on Linux

Thanks for the support

@pkozlowski-opensource
Copy link
Member

So, this is not really the isArrayLike that is at fault here but rather copy that doesn't recognise "special" typed arrays and treats them as any other object.

The real question here is this: do we want to support Float32Array and friends with copy. My take would be that no but I would be interested to hear more about your real-life use case @digitalillusion

@pkozlowski-opensource pkozlowski-opensource changed the title isArrayLike not working with typed arrays angular.copy doesn't work with typed arrays Nov 25, 2014
@digitalillusion
Copy link
Author

Well... the Web Audio API is using Float32Array and I would expect angular to be able to copy an object containing an audio buffer

@pkozlowski-opensource
Copy link
Member

This was fixed in master via aa0f644

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants