Subj : Re: Property Getter & Setter Question To : Brendan Eich From : Digital Man Date : Fri Nov 19 2004 11:27 pm Re: Re: Property Getter & Setter Question By: Brendan Eich to lyg on Fri Nov 19 2004 07:11 pm > lyg wrote: > > if I defined the getter and setter for a property.When I get the proper > > with objName.propertyName, It will call the getter and return the property > > value, but Why to set the value to the obj->slots[slot]? > > In other word, since I have defined a getter, It seems that it is not > > neccessary to store the property value into obj->slots[slot]. > > Is there someone explain the reason for me? > > > Backward compatibility. Use the JSPROP_SHARED attribute if you don't > want a slot to store the last-got-or-set value. Is there any advantage or disadvantage to setting this attribute (memory consumption, performance, etc.)? If you have getter/setter functions for a property, is there any reason that you *shouldn't* set this attribute? I didn't know about this attribute as it's not documented at: http://www.mozilla.org/js/spidermonkey/apidoc/sparse-frameset.html I need to browse here more often. :-) digital man Snapple "Real Fact" #28: Chewing gum while peeling onions will prevent you from crying. .