Last Comment Bug 593396 - implement typed arrays BYTES_PER_ELEMENT
: implement typed arrays BYTES_PER_ELEMENT
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
-- normal (vote)
: ---
Assigned To: Vladimir Vukicevic [:vlad] [:vladv]
: Jason Orendorff [:jorendorff]
Depends on:
  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:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

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 User image 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 User image 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 User image 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.

Comment 3 User image Vladimir Vukicevic [:vlad] [:vladv] 2010-09-03 13:24:23 PDT -- WebGL component for now.  Is it really that gross?  Seems like it's useful to have it in both places...
Comment 4 User image 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.

Comment 5 User image Tom Schuster [:evilpie] 2012-01-14 11:22:50 PST

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