[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] TypedArray constructors and zero length
On Thu, Jun 10, 2010 at 01:42, Vladimir Vukicevic <firstname.lastname@example.org>
0 is a valid length; you should be able to create 0-length arrays as necessary, otherwise there's no way to represent a valid empty array. You'd have to pass null, which means special casing everything that works with arrays to understand null.
Not sure to get what you imply by "special casing everything that works with arrays" ?
TypedArray are interface types so null is already a potential 'legal' value to take care of afaik.
In my understanding supporting 0-length arrays requires additional special casing on top of that, for avoiding divide by zero and internal memory housekeeping.
And as the length is already unsigned, then it can't ever be negative, so I don't think we need to do any special language here.
I see, so what should happen in this case ? TYPE_ERR ?