[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] Differing TypedArray#set behavior
2012/4/13 Stéphan Kochen <email@example.com>
I was more surprised mixing type was allowed like this, and I suppose it's because it also accepts a plain Array. If it weren't for that, everyone would simply be calling memmove().
It's not actually like memcpy/memmove, because of the conversion that happens if the types are different. It's only memmove if the types happen to be the same.
As an aside, it doesn't seem like the conversion is actually defined, eg. if you set() an Int16Array onto an Int8Array and some values overflow. I'm not sure where the conversion is defined even for eg. array8 = 2000 (somewhere in WebIDL, I assume), but set() should use the same rules.