Subj : Re: Property resolution To : Thomas Sondergaard From : Brendan Eich Date : Sat Jul 30 2005 12:00 pm Thomas Sondergaard wrote: > Does spidermonkey maintain a map of properties even if I provide > setter/getter functions in my JSClass? I can see that my setter/getters > get called but even if they do nothing but return JS_TRUE the property > is set. If you implement JSClass hooks, you are using generic property mapping and property value (slot) storage machinery in SpiderMonkey. If you want no such generic value storage, use JSPROP_SHARED among the property's attributes. If you want to manage your own mapping from id in an object to value, attributes, getter/setter, and other property fields, you will have to implement JSObjectOps yourself. This is not recommended. > How are properties resolved when setting and getting them? What do you mean by resolved? If you mean looked up, as in [[HasProperty]] in ECMA-262, then for properties of native objects (ones where you specialize at the JSClass layer), properties are looked up by high-level (JSObjectOps layer) get and set operations implemented in jsobj.c (js_GetProperty, js_SetProperty; these call js_LookupProperty). /be .