Closed Bug 593396 Opened 10 years ago Closed 8 years ago

implement typed arrays BYTES_PER_ELEMENT

Categories

(Core :: JavaScript Engine, defect)

defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: vlad, Assigned: vlad)

Details

Attachments

(1 file)

The spec wants this constant, because it's helpful when dealing with APIs that want to use this (such as WebGL) where you have to specify some things using byte offsets.
Attachment #471882 - Flags: review?(jorendorff)
Comment on attachment 471882 [details] [diff] [review]
add BYTES_PER_ELEMENT constant

r=shaver, if the spec really requires it to be on both prototype and constructor (gross).
Attachment #471882 - Flags: review?(jorendorff) → review+
Where do we file spec bugs? Gotta avoid freezing those early mistakes (I should know!). We supposedly have grounds for hoping that WebGL JS bindings can change.

/be
http://www.khronos.org/bugzilla/ -- WebGL component for now.  Is it really that gross?  Seems like it's useful to have it in both places...
It's formally gross to have it in two places, but on the prototype it also intrudes as if per-instance, when it's not. Usually constants are on the ctor (after "class statics"). But maybe usability favors on the proto, and since typed arrays are non-extensible, there's no shadowing hazard. I'll hold off on filing.

/be
https://hg.mozilla.org/mozilla-central/rev/b8941721844a/
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.