Subj : Re: (Spidermonkey) Converting a property name to a tinyId To : James Turner From : Brendan Eich Date : Wed Mar 19 2003 07:27 pm > > >My objects have 3 kinds of properties - native/builtin ones, ones >inherited from their prototype, and ad-hoc ones. I need to be aware of >when any property has changed, and depending on the name, take action. >Notably, I need to mark the object as 'dirty', so that it's persisted >when the last reference is dropped. When I move to a distributed >object system, it's possible my jsobject will actually wrap a native >proxy which needs to marshal the property values over the wire, or I >may need to obtain an exclusive-write lock on the entity before >continuing. > >So, as I said, I need a way to control *all* property accesses, to >achieve these kinds of behaviours. As i said, I can certainly achieve >this with some fiddling of how I define properties, but it would be >less than clean, so if there's a better way I'm interested. > >Sorry this is dragging out rather seriously... > Don't worry about it. Concrete examples still craved. If you need to intercept operations at the level above where JSClass hooks get called, above where prototype chains are followed, then you might consider implementing JSObjectOps. Beware, it's not really a frozen API. /be >James > > .