Subj : Re: Class properties To : netscape.public.mozilla.jseng From : Niklas Lindquist Date : Fri Oct 29 2004 07:22 pm Thanks. Halfway there. Now I know its possible. But I need the other half aswell. :) How is such a class property defined from within the SpiderMonkey perspective, i.e. in my C source counterpart. I want the 'modeOut' to have a predefined (read-only) value. It's been buggin me for quite a while now. Using a getter for the property requires an instance, so there must be another way. TIA /Niklas "Martin Honnen" wrote in message news:clrc2o$nlc3@ripley.netscape.com... > > > Niklas Lindquist wrote: > > > Is it at all possible to create class properties (as oppose to instance > > properties). > > What I would like to achieve is something similar to C enums to use as > > parameters for certain functions. > > > > Example: > > var s = new Stream; > > s.open(Stream.modeOut); > > function Stream () { } > Stream.modeOut = 42; > can certainly be done in JavaScript. > > > -- > > Martin Honnen > http://JavaScript.FAQTs.com/ .