Last Comment Bug 593396 - implement typed arrays BYTES_PER_ELEMENT
: implement typed arrays BYTES_PER_ELEMENT
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: Vladimir Vukicevic [:vlad] [:vladv]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-09-03 09:38 PDT by Vladimir Vukicevic [:vlad] [:vladv]
Modified: 2012-01-14 11:22 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
add BYTES_PER_ELEMENT constant (2.73 KB, patch)
2010-09-03 09:38 PDT, Vladimir Vukicevic [:vlad] [:vladv]
shaver: review+
Details | Diff | Splinter Review

Description Vladimir Vukicevic [:vlad] [:vladv] 2010-09-03 09:38:41 PDT
Created attachment 471882 [details] [diff] [review]
add BYTES_PER_ELEMENT constant

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.
Comment 1 Mike Shaver (:shaver -- probably not reading bugmail closely) 2010-09-03 09:42:10 PDT
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).
Comment 2 Brendan Eich [:brendan] 2010-09-03 13:02:43 PDT
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
Comment 3 Vladimir Vukicevic [:vlad] [:vladv] 2010-09-03 13:24:23 PDT
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...
Comment 4 Brendan Eich [:brendan] 2010-09-03 13:41:04 PDT
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
Comment 5 Tom Schuster [:evilpie] 2012-01-14 11:22:50 PST
https://hg.mozilla.org/mozilla-central/rev/b8941721844a/

Note You need to log in before you can comment on or make changes to this bug.