Subj : Re: [SpiderMonkey] Confused about class property To : Peter Paulus From : Brendan Eich Date : Tue Oct 04 2005 12:37 pm Peter Paulus wrote: > > > Not just to start a monologue, I've disassembled the javascript: > > var x = ColorSpace.lab; > > into: > > 00000: 0 defvar "x" > main: > 00003: 0 bindname "x" > 00006: 0 name "ColorSpace" > 00009: 0 getprop "lab" > 00012: 0 setname "x" > 00015: 0 pop > > So I guess it must be the interpreter that turns ColorSpace into a > Function object, rather than an 'ColorSpace' object. > > Are there flags on my JSClass struct or otherwise to manipulate this > behavior? If you don't want your call to JS_InitClass to bind a constructor to the class name in the global object, pass null for the |constructor| formal parameter. Then the class name will denote a prototype object of your class, containing the properties and methods (not the static properties and methods) you specify. /be .