Subj : Re: (Spidermonkey) Converting a property name to a tinyId To : netscape.public.mozilla.jseng From : zakalawe@mac.com (James Turner) Date : Wed Mar 19 2003 02:41 pm Brendan Eich wrote in message news:<3E77A8A9.8020505@meer.net>... > > So > >you can't write 'filtering' property ops, at least as I currently > >understand it. > > > > Watchpoints are implemented as setter filters. I'm not sure exactly > what you want to do, though. Perhaps a concrete example would make > things clear. At this risk of being laughed at a lot, I shall explain what I'm up to. Keep in mind that, following your (Brendan's) clarification of what's happening with propertyOps, I do now know a way to achieve what I want, it's just a bit 'interesting'. Anyway, here is what I am up to. 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... James .