Subj : [SpiderMonkey] Confused about class property To : netscape.public.mozilla.jseng From : Peter Paulus Date : Fri Sep 30 2005 05:01 pm Hello all, In my host class 'ColorSpace' I've added, a.o., a class property 'lab' with flags: JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_GETTER | JSPROP_SHARED and a getter: getClassProperty(). This property mimics a value where in other languages one would use an enumeration. My testscript contains: var x = ColorSpace.lab; When getClassProperty() is invoked the tinyid is correct. But the JSobject* obj parameter supplied, contains a Function object, instead of an object of class "ColorSpace". The 'this' object retrieved from the stackframe is my global object. I have been fiddling with the flags of JSClass and JSPropertySpec, but I can't seem to find how to set them correctly. Most of the time js_InvokeInternal() is invoked and crashes. I do realize that there is a possibility to say in javascript: if (ColorSpace.convert) { ... } else { ... } In order to check if a method exists. Can I take any actions as to resolve the ambiguity between getting a 'class' property and checking for the existence of a method. Thank you in advance. With kind regards, Peter Paulus .